Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering unwanted messages

Status
Not open for further replies.

gorgor

Programmer
Aug 15, 2002
164
US
I have a windows form that instantiates another top level form. The top level form then 'shows' itself. The second form floats around the screen following the cursor. (Basically I've created my own tool tip control.) The tooltip has to be a top-level window so that it doesn't get hidden behind the other form whenever the mouse is clicked. I have one issue that I need to resolve so I can call it a full-fledged tooltip control:

When my custom tooltip pops up, it takes the focus away from the original form. I can always give focus back to the original form, but it causes a flickering effect in the original form's title bar. Yuck! I've overriden the tool tip's WndProc method and "nulled" out the SETFOCUS and ACTIVATE messages but it is still pulling focus away from the original form. I've monitored the messages that are being sent to the original form and KILLFOCUS is never being sent to it. However, the original form is still losing focus when the tooltip pops up. I just can't figure it out!

Any ideas?? I NEVER want my custom tooltip control to get the input focus. I want the focus to stay with the original form.
 
If you want the tooltip control never get the input focus then you should trap WM_SETFOCUS for it and redirect the focus to another window. To avoid potential deadlocks try to use SendNotifyMessage() or SendMessageTimeout() functions. I think the problem is in the overloaded WndProc().
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top