how create control in non-client area

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.
 
S

subash

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
 
J

Joe White

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.
 

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