CreateWindowEx / RegisterClass

J

James L

I have been trying to p/invoke RegisterClass and CreateWindowEx to create
'floating' tooltip style windows in my app that I can add text and graphics
to. I cannot see how to assign a WndProc function pointer to the WNDCLASS
object. Is this possible or is there another way I could go about it?

I want to be able to trigger the window from controls, I wrote a custom
control to do what I wanted but couldn't get the triggering control to draw
outside it's own bounds.

thanks

James
 
C

Chris Tacke, eMVP

You *may* be able to use a MessageWindow class and pass it its handler to
it, though I don't think the function pointer will cross the P/Invoke
boundary properly. It's worth a try, but don't get your hopes up.

-Chris
 
P

Peter Foot [MVP]

An alternative is to use a panel control (which you keep hidden until
required) which you can move around and place over your form to simulate a
tooltip. This technique is used in the Pocket TaskVision sample
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/
html/wnf_pkttaskvision.asp) to create a floating progress dialog.
This way will not require any P/Invokes to native APIs and should be fairly
simple to implement.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top