Windows Programming :: Troubles with SC_MOVE

Started by
1 comment, last by NoLoGiC 20 years ago
Hey everyone! Hopefully someone smarter than I can help me figure out why my screen goes all crazy when I try to move my multiple windows across the screen Here''s my setup: I am designing a small "post-it" program to help me stay organized (and for portfolio exp ) I create each post-it via the following styles: cwnd = CreateWindowEx(WS_EX_TOOLWINDOW , "Sticky_Note", "Sticky Note", WS_POPUP | WS_VISIBLE | WS_THICKFRAME, 0, 0, 200,200, NULL, NULL,hInstance, NULL) Now since it''s a popup window, there is no caption bar to drag so that the window moves. Instead, I use a left click and drag to move the window: case WM_LBUTTONDOWN: { SendMessage(cwnd, WM_SYSCOMMAND, SC_MOVE + 2, 0); }break; While reading various forums, I found that SC_MOVE lets the window move like I want it to. I ran into the problem that by just using SC_MOVE, it only moves with the keyboard. Adding 2 to SC_MOVE fixes that problem (not really sure why, saw it in a forum), but as I position my post-it windows on the screen...occasionally my screen flickers and the entire desktop glitches with a full-screen ghosted image of the "note". Anyone know what''s up? Thanks 2^1337 for taking the time to read this, NoLoGiC
Advertisement
There is a better way to do this using SetCapture()/ReleaseCapture() and SendMessage() with WM_NCLBUTTONDOWN.

Although it is in VB, this link should help you out with some example code.

Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
Checking it out now, thanks!

This topic is closed to new replies.

Advertisement