Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C/C++

C/C++ C/C++ Discussion

Reply
 
Thread Tools Display Modes
Old 06-01-2006, 05:29 PM   #1 (permalink)
 
Join Date: Aug 2005
Location: Woodward, OK
Age: 34
Posts: 67
Default VC++ Global Hook DLL Oddity

I'm using Visual C++ Express
I've created a DLL for a global hook
I've tried this with both the GetMessage hook and the standard Mouse hook

In both cases I'm met with the same results. I'm simply trying to catch when someone right clicks on a forms minimize button. Naturally I'm watching for the WM_NCRBUTTONUP message to accomplish this. What happens is truly odd indeed. When the hooks are in place the hook doesn't trigger properly when I click the minimize button. If I click dead center or to the left of dead center on the minimze button with my right mouse button I get a system menu. If I click to the right of dead center over almost to the right border of the minimize button then my hook triggers properly but only far over to the right edge of the button. I've tested this with the maximize button and close button and they both function properly. Also if I use the left mouse button on my minimize button everything performs as expected. The only time this happens is in MY code and with the RIGHT MOUSE button.

Got any ideas? I can attach my projects if you need them.
wreckage is offline   Reply With Quote
Old 06-02-2006, 01:47 PM   #2 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 27
Posts: 4,818
Default

Just a suggestion but you should show the code so that if its something small you missed someone might be able to point it out
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Old 06-02-2006, 09:10 PM   #3 (permalink)
 
Join Date: Aug 2005
Location: Woodward, OK
Age: 34
Posts: 67
Default

Quote:
Originally Posted by Sorious
Just a suggestion but you should show the code so that if its something small you missed someone might be able to point it out
Actually I used a program similar to Microsoft Spy++ to discover that it is actually a bug in Windows.

Non-Client mouse clicks are supposed to result in the following messages:
WM_NCRBUTTONDOWN
WM_NCRBUTTONUP

In the case of the close and maximize buttons this is the case, however when you click on the minimize button this is the results:
WM_NCRBUTTONDOWN
WM_RBUTTONUP <------- This is not a non-client message and should not occur on any non-client areas of the window.

With this in mind there is nothing I can do and there is no error in my code.
wreckage is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5