Thread: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-01-29 23:15:23
|
Oddly enough, I'm also not receiving WA_CLICKACTIVE in WM_ACTIVATE...curiouser and curiouser. > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Brian Hook > Sent: Tuesday, January 29, 2002 3:01 PM > To: gam...@li... > Subject: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > > Here's a weird one. I'm trying to change my app so that when > a mouse click activates a window I automatically discard the > mouse click (so that unpausing doesn't inadvertently allow > the user to exit the game, restart, etc.). > > I was originally going to do this programmatically by letting > my main app look at the timestamps of the last activation > message vs. incoming mouse down events, but the delta can > vary by a significant amount of time (at least 2ms). Trying > to make this work by altering the tolerance seems iffy at best. > > The next thing I decided to look at was WA_CLICKACTIVE, but > while looking at that I found WM_MOUSEACTIVATE and returning > MA_ACTIVATEANDEAT. Unfortunately, my app NEVER sees a > WM_MOUSEACTIVATE > -- I've confirmed this with Spy++. This is on Win2K. > However, someone else I know sees this event just fine -- any > ideas what's going on here? > > Failing WM_MOUSEACTIVATE, I'll look into WA_CLICKACTIVE and > set a flag to ignore the next mouse message, but now I'm > curious what's up with WM_MOUSEACTIVATE. > > Brian > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > |
From: Brian H. <bri...@py...> - 2002-01-29 23:39:38
|
> Oddly enough, I'm also not receiving WA_CLICKACTIVE in > WM_ACTIVATE...curiouser and curiouser. Okay, it's gone from curious to annoying. If I click on my app's title bar, I get WM_MOUSEACTIVATE and WM_ACTIVATE/WA_CLICKACTIVE. If I click in the client area, however, I only get WM_ACTIVATE/WA_ACTIVE. It's a pretty vanilla window. The only thing I can think of is that some of the documentation throws around "Child window" as a term a lot, and since the only child windows I have are created by Windows (title bar, system menu), that my problem lies with that. Brian |
From: Andrew G. <an...@ra...> - 2002-01-29 23:57:00
|
Do you call DefWindowProc at the bottom of your message loop? // andrew ----- Original Message ----- From: "Brian Hook" <bri...@py...> To: <gam...@li...> Sent: Tuesday, January 29, 2002 11:39 PM Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > Oddly enough, I'm also not receiving WA_CLICKACTIVE in > > WM_ACTIVATE...curiouser and curiouser. > > Okay, it's gone from curious to annoying. If I click on my app's title > bar, I get WM_MOUSEACTIVATE and WM_ACTIVATE/WA_CLICKACTIVE. If I click > in the client area, however, I only get WM_ACTIVATE/WA_ACTIVE. It's a > pretty vanilla window. The only thing I can think of is that some of > the documentation throws around "Child window" as a term a lot, and > since the only child windows I have are created by Windows (title bar, > system menu), that my problem lies with that. > > Brian > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > |
From: Nathan R. <Nat...@te...> - 2002-01-29 23:49:00
|
Are you even recieving WM_NCHITTEST messages? If anything, that might prove useful in tracking down which window is the culprit.. -----Original Message----- From: Brian Hook [mailto:bri...@py...] Sent: Tuesday, January 29, 2002 5:40 PM To: gam...@li... Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > Oddly enough, I'm also not receiving WA_CLICKACTIVE in > WM_ACTIVATE...curiouser and curiouser. Okay, it's gone from curious to annoying. If I click on my app's title bar, I get WM_MOUSEACTIVATE and WM_ACTIVATE/WA_CLICKACTIVE. If I click in the client area, however, I only get WM_ACTIVATE/WA_ACTIVE. It's a pretty vanilla window. The only thing I can think of is that some of the documentation throws around "Child window" as a term a lot, and since the only child windows I have are created by Windows (title bar, system menu), that my problem lies with that. Brian _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows |
From: Brian H. <bri...@py...> - 2002-01-29 23:54:29
|
> Are you even recieving WM_NCHITTEST messages? If anything, > that might prove useful in tracking down which window is the culprit.. Nope, those aren't showing up in Spy++ either. Brian |
From: Brian H. <bri...@py...> - 2002-01-30 00:02:19
|
Yep. DefWindowProc() gets called on all messages except the ones it shouldn't =) (specifically, WM_CREATE, WM_DESTROY and WM_ERASEBKGND). Brian > -----Original Message----- > From: gam...@li... > [mailto:gam...@li...] On > Behalf Of Andrew Grant > Sent: Tuesday, January 29, 2002 3:57 PM > To: gam...@li... > Subject: Re: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > > Do you call DefWindowProc at the bottom of your message loop? > > > // andrew > > ----- Original Message ----- > From: "Brian Hook" <bri...@py...> > To: <gam...@li...> > Sent: Tuesday, January 29, 2002 11:39 PM > Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > > > > Oddly enough, I'm also not receiving WA_CLICKACTIVE in > > > WM_ACTIVATE...curiouser and curiouser. > > > > Okay, it's gone from curious to annoying. If I click on my app's > > title bar, I get WM_MOUSEACTIVATE and > WM_ACTIVATE/WA_CLICKACTIVE. If > > I click in the client area, however, I only get > WM_ACTIVATE/WA_ACTIVE. > > It's a pretty vanilla window. The only thing I can think > of is that > > some of the documentation throws around "Child window" as a term a > > lot, and since the only child windows I have are created by Windows > > (title bar, system menu), that my problem lies with that. > > > > Brian > > > > > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > |
From: Andrew G. <an...@ra...> - 2002-01-30 00:18:24
|
Mad. Do you get the same problem on the DirectDraw "Windowed" sample? (part of the DX8 SDK). I get all the expected messages from that and it's a fairly basic sample so might give you something to comapre your app with, or see how the order of messages differs from yours. It's probably one of those fun "oh I have to do that?" Windows problems :) // andrew ----- Original Message ----- From: "Brian Hook" <bri...@py...> To: <gam...@li...> Sent: Wednesday, January 30, 2002 12:02 AM Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > Yep. DefWindowProc() gets called on all messages except the ones it > shouldn't =) (specifically, WM_CREATE, WM_DESTROY and WM_ERASEBKGND). > > Brian > > > -----Original Message----- > > From: gam...@li... > > [mailto:gam...@li...] On > > Behalf Of Andrew Grant > > Sent: Tuesday, January 29, 2002 3:57 PM > > To: gam...@li... > > Subject: Re: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > > > > > Do you call DefWindowProc at the bottom of your message loop? > > > > > > // andrew > > > > ----- Original Message ----- > > From: "Brian Hook" <bri...@py...> > > To: <gam...@li...> > > Sent: Tuesday, January 29, 2002 11:39 PM > > Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > > > > > > > Oddly enough, I'm also not receiving WA_CLICKACTIVE in > > > > WM_ACTIVATE...curiouser and curiouser. > > > > > > Okay, it's gone from curious to annoying. If I click on my app's > > > title bar, I get WM_MOUSEACTIVATE and > > WM_ACTIVATE/WA_CLICKACTIVE. If > > > I click in the client area, however, I only get > > WM_ACTIVATE/WA_ACTIVE. > > > It's a pretty vanilla window. The only thing I can think > > of is that > > > some of the documentation throws around "Child window" as a term a > > > lot, and since the only child windows I have are created by Windows > > > (title bar, system menu), that my problem lies with that. > > > > > > Brian > > > > > > > > > _______________________________________________ > > > Gamedevlists-windows mailing list > > > Gam...@li... > > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > > > > > > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > |
From: Brian S. <bs...@mi...> - 2002-01-30 00:36:09
|
Do you ever call SetCapture() to capture the mouse? And if yes, do you call ReleaseCapture() on deactivate? > -----Original Message----- > From: Brian Hook [mailto:bri...@py...] > Sent: Tuesday, January 29, 2002 3:54 PM > To: gam...@li... > Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE >=20 > > Are you even recieving WM_NCHITTEST messages? If anything, > > that might prove useful in tracking down which window is the culprit.. >=20 > Nope, those aren't showing up in Spy++ either. >=20 > Brian |
From: Brian H. <bri...@py...> - 2002-01-30 01:03:17
|
> Do you ever call SetCapture() to capture the mouse? Yes. > And if yes, do you call ReleaseCapture() on deactivate? Yes. This might be related to the overall problem, however, so I'll look into that. Right now I'm capturing the mouse on WM_MOUSEMOVE also, although I don't remember why =) Basically, if I get a WM_MOUSEMOVE and the point is in the client area, then I do a SetCapture(). If I comment this line out, the cursor disappears in the title bar (it's user draw in the client area and system draw outside the window, but in the titlebar nothing happens). I would love to be able to get rid of my calls to SetCapture() though. Brian |
From: Andrew G. <an...@ra...> - 2002-01-30 01:19:06
|
I guess you have something like ShowCursor(FALSE); in your program to hide the system cursor so you can draw your own? Instead of using SetCapture, why not detect WM_NCMOUSEMOVE messages and make the system cursor visible so that it is displayed in the title bar. // andrew ----- Original Message ----- From: "Brian Hook" <bri...@py...> To: <gam...@li...> Sent: Wednesday, January 30, 2002 1:03 AM Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > > Do you ever call SetCapture() to capture the mouse? > > Yes. > > > And if yes, do you call ReleaseCapture() on deactivate? > > Yes. > > This might be related to the overall problem, however, so I'll look into > that. Right now I'm capturing the mouse on WM_MOUSEMOVE also, although > I don't remember why =) Basically, if I get a WM_MOUSEMOVE and the > point is in the client area, then I do a SetCapture(). If I comment > this line out, the cursor disappears in the title bar (it's user draw in > the client area and system draw outside the window, but in the titlebar > nothing happens). > > I would love to be able to get rid of my calls to SetCapture() though. > > Brian > > > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > |
From: Brian H. <bri...@py...> - 2002-01-30 01:17:58
|
> This might be related to the overall problem Well, removing SetCapture() allowed me to get those messages. > line out, the cursor disappears in the title bar (it's user > draw in the client area and system draw outside the window, > but in the titlebar nothing happens). The above remains a problem -- I can get rid of the calls to SetCapture() if I'm willing to live with an invisible cursor on the titlebar. This is rather bothersome since it makes moving the window around very difficult. -Brian |
From: Brian S. <bs...@mi...> - 2002-01-30 01:29:21
|
> > This might be related to the overall problem >=20 > Well, removing SetCapture() allowed me to get those messages. >=20 > > line out, the cursor disappears in the title bar (it's user > > draw in the client area and system draw outside the window, > > but in the titlebar nothing happens). >=20 > The above remains a problem -- I can get rid of the calls to > SetCapture() if I'm willing to live with an invisible cursor on the > titlebar. This is rather bothersome since it makes moving the window > around very difficult. I think SetCapture is just going to cause you problems...I never had to use it to write things that ran in a window. Are you giving your window a cursor in your WNDCLASS (when you call RegisterClass)? If you didn't do that, I wouldn't be surprised if you didn't get a cursor in your non-client area (you know, the hipster term for the title bar :). I believe that ShowCursor will still control cursor visibility in your client area (which is what you want, since you're drawing your own there), so it shouldn't affect your app. If that's not it, then it beats the hell outta me! --brian |
From: Brian H. <bri...@py...> - 2002-01-30 01:33:00
|
> I guess you have something like ShowCursor(FALSE); Exactly. > Instead of using SetCapture, why not detect WM_NCMOUSEMOVE > messages and make the system cursor visible so that it is > displayed in the title bar. Hey, that works! =) Originally I was using SetCapture() because WM_MOUSEMOVE wouldn't report movements outside the client area (so I didn't know when to ShowCursor( TRUE )), not to mention the cursor wasn't being drawn correctly in the titlebar. By also trapping WM_NCMOUSEMOVE and doing a ScreenToClient() and posting that as a regular mousemove to my own event queue, it allowed me to ditch SetCapture() -- however, since I wasn't sure I was going to be able to fix all this, I ended up removing my dependency on WA_CLICKACTIVE =| Anyway, looks like things are much better structured now. Less cruft, that's for sure. Thanks to everyone that helped! Brian |
From: Matt D. <ma...@co...> - 2002-01-30 10:00:26
|
It's important to note that Windows' makes a huge distinction between client and non-client areas of the window and has mutually exclusive messages to deal with the two areas. I know I keep forgetting about WM_NCxxx messages :-( Matt Davies Programmer, Confounding Factor ma...@co... www.confounding-factor.com -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of Brian Hook Sent: 30 January 2002 01:33 To: gam...@li... Subject: RE: [GD-Windows] WA_CLICKACTIVE vs. WM_MOUSEACTIVATE > I guess you have something like ShowCursor(FALSE); Exactly. > Instead of using SetCapture, why not detect WM_NCMOUSEMOVE > messages and make the system cursor visible so that it is > displayed in the title bar. Hey, that works! =) Originally I was using SetCapture() because WM_MOUSEMOVE wouldn't report movements outside the client area (so I didn't know when to ShowCursor( TRUE )), not to mention the cursor wasn't being drawn correctly in the titlebar. By also trapping WM_NCMOUSEMOVE and doing a ScreenToClient() and posting that as a regular mousemove to my own event queue, it allowed me to ditch SetCapture() -- however, since I wasn't sure I was going to be able to fix all this, I ended up removing my dependency on WA_CLICKACTIVE =| Anyway, looks like things are much better structured now. Less cruft, that's for sure. Thanks to everyone that helped! Brian _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows |