how create control in non-client area

  • Thread starter Thread starter Alex Feinberg
  • Start date Start date
A

Alex Feinberg

If what you want to do is show your control somewhat like a ToolTip or
the drop--down from a ComboBox, you can add the control to the desktop
using Win32 API calls.

Use the API call GetDesktopWindow() to obtain a handle to the desktop,
then use the API call SetParent() (passing your control's handle and
the handle you obtained using GetDesktopWindow) to set your control's
parent to the desktop.

You'll probably also want to use the SetWindowLong() API call to make
sure your control has the extended window styles WS_EX_TOOLWINDOW (so
it doesn't appear in the taskbar) and WS_EX_TOPMOST (so it shows up
above your application's window).

Search Google Groups or MSDN for more info on those calls -- you'll
find better documentation there than I could ever write.
 
Hi All

how to create controls in non-client area of forms or usercontrol.Can any
one help in getting information on this or solution for this.

regards
subash
 
In general, I'd say putting controls into the non-client area is a bad idea.

Exactly what is it you're trying to accomplish? There may be easier ways.
 
Back
Top