Windows forms scribble sample




















After probing the depths of the MSDN Library and reading more than anyone cares to hear about the details of mouse-message processing in Windows, I was unable to definitively determine whether this is even possible. Call me paranoid, but somehow I'm reluctant to use GetKeyState to check for mouse button states. And who should have to worry whether the user is left-handed?

Never fear, in Windows there's always another way. Figure 5 shows the details. Note that if you want the dialog to display the system menu when the user right-clicks on the caption, your context menu handler should pass control to the base handler if the cursor isn't in the client area.

This is true whether you're using the hit-test trick or not; even in a vanilla dialog, you should perform this check. Figure 6 and Figure 7 show the revised MoveDlg program from my December column, with system and context menus. So which solution should you use? Rocco's has the advantage of being confined to a single function, but it seems too low level. You shouldn't have to worry about virtual key states or whether the user has swapped mouse buttons unless you're writing drivers or other grungy stuff.

Send your questions and comments for Paul to cppqa microsoft. Skip to main content. This browser is no longer supported. PrintPreviewDialog ; System. Help; System. PrintDocument ; System. Pen; System. Graphics; System. DrawLine; System. ArrayList; System. Visual C Samples General Samples. Net Software , all rights reserved. Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster ucancode. Home Products Purchase Support Downloads. Overview Download Purchase. Technical Support. From the Build menu, click Build Solution. From the Debug menu, click Start Without Debugging. Skip to content. This repository has been archived by the owner.

It is now read-only. Star Branches Tags. Could not load branches. Could not load tags. Latest commit. Git stats 48 commits.



0コメント

  • 1000 / 1000