Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Windows Programming :: Troubles with SC_MOVE

This topic is 5201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!