Form always on bottom but allow dragging with mouse?
Posted on 2003-12-11
I'm trying to make a form that is "pinned" to the desktop but can be also dragged around with the mouse. I've used:
SetWindowPos(WindowHandle, HWND_BOTTOM, 0,0,0,0, SWP_NOMOVE or SWP_NOSIZE);
to send it to the bottom, but whenever it is clicked on it becomes activated and is on top.
I added the same line of code to the form's FormMouseDown method but this results in the window being temporarily shown then disappearing which is annoying (and also sometimes doesn't get sent back at all - it stays on top).
Is there some way (via messages or something) that I can have the form stay permanently on the bottom yet still drag it around with the mouse? Perhaps by intercepting the mouse click, trapping the mouse dragging stuff but not activating the window? I'm not that familiar with window messaging so I'm not sure what is and isn't possible.
Also another (maybe related problem?) I am having is when I click the "Show Desktop" button, my form briefly disappears, then reappears, and if I click on it, it disappears! (Only to reappear if I click where it was). Very odd.
Any help would be greatly appreciated :)