Thread: RE: [GD-Windows] Detecting mouse exiting window?
Brought to you by:
vexxed72
From: Andy G. <an...@mi...> - 2002-08-02 23:43:54
|
Have you tried WM_MOUSELEAVE which is in Win98-> ? -----Original Message----- From: Brian Hook [mailto:bri...@py...]=20 Sent: Friday, August 02, 2002 4:32 PM To: gam...@li... Subject: [GD-Windows] Detecting mouse exiting window? Is there a clean way of detecting when the mouse cursor has exited my window? WM_MOUSEMOVE and WM_NCMOUSEMOVE messages stop coming in the moment the mouse exits the window. The only other thing I can think of is to actually poll the mouse position and see if it's in my client area (blech). Brian ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |
From: Brian H. <bri...@py...> - 2002-08-02 23:46:39
|
Er, no, especially since it's nowhere in my help docs =( And, unfortunately, I need to run on Win95 still (yeah yeah yeah...). I "fixed" the problem by sitting in my WM_TIMER and calling GetCursorPos() and generating application mouse moved events if the mouse it outside the window. *puke* But it works. =) Thanks, -Hook > -----Original Message----- > From: Andy Glaister [mailto:an...@mi...] > Sent: Friday, August 02, 2002 4:44 PM > To: Brian Hook; gam...@li... > Subject: RE: [GD-Windows] Detecting mouse exiting window? > > > Have you tried WM_MOUSELEAVE which is in Win98-> ? > > -----Original Message----- > From: Brian Hook [mailto:bri...@py...] > Sent: Friday, August 02, 2002 4:32 PM > To: gam...@li... > Subject: [GD-Windows] Detecting mouse exiting window? > > > Is there a clean way of detecting when the mouse cursor has > exited my window? WM_MOUSEMOVE and WM_NCMOUSEMOVE messages > stop coming in the moment the mouse exits the window. The > only other thing I can think of is to actually poll the mouse > position and see if it's in my client area (blech). > > Brian > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > |
From: Julien K. <ma...@ju...> - 2002-08-03 10:37:28
|
You can Capture the Mouse-Cursor. Than you will get all Mouse-Move-Messages and you can check if the Mouse-Pos is still in your Window. Julien ----- Original Message ----- From: "Brian Hook" <bri...@py...> To: <gam...@li...> Sent: Saturday, August 03, 2002 1:46 AM Subject: RE: [GD-Windows] Detecting mouse exiting window? > Er, no, especially since it's nowhere in my help docs =( > > And, unfortunately, I need to run on Win95 still (yeah yeah yeah...). > > I "fixed" the problem by sitting in my WM_TIMER and calling > GetCursorPos() and generating application mouse moved events if the > mouse it outside the window. *puke* But it works. =) > > Thanks, > > -Hook > > > -----Original Message----- > > From: Andy Glaister [mailto:an...@mi...] > > Sent: Friday, August 02, 2002 4:44 PM > > To: Brian Hook; gam...@li... > > Subject: RE: [GD-Windows] Detecting mouse exiting window? > > > > > > Have you tried WM_MOUSELEAVE which is in Win98-> ? > > > > -----Original Message----- > > From: Brian Hook [mailto:bri...@py...] > > Sent: Friday, August 02, 2002 4:32 PM > > To: gam...@li... > > Subject: [GD-Windows] Detecting mouse exiting window? > > > > > > Is there a clean way of detecting when the mouse cursor has > > exited my window? WM_MOUSEMOVE and WM_NCMOUSEMOVE messages > > stop coming in the moment the mouse exits the window. The > > only other thing I can think of is to actually poll the mouse > > position and see if it's in my client area (blech). > > > > Brian > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Gamedevlists-windows mailing list > > Gam...@li... > > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > > Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Javier A. <ja...@py...> - 2002-08-05 07:08:35
|
Julien Koenen <ma...@ju...> wrote: > You can Capture the Mouse-Cursor. > Than you will get all Mouse-Move-Messages and you can check if the > Mouse-Pos is still in your Window. I strongly advise against this. It will hurt you later with usability problems when the user wonders why his mouse doesn't seem to work properly. Javier Arevalo Pyro Studios |
From: jason z. <dir...@21...> - 2002-08-05 07:40:25
|
VGhlcmUgd2FzIGEgY29tcGlsZSB3YXJuaW5nIHdoZW4gSSAgdXNlIHRlbXBsYXRlIGluIG15IGV4 cG9ydCBjbGFzcyBvZiBETEwuICBBbmQgdGhlIGNvbXBpbGVyDQp3aWxsIGdpdmUgYW4gZXJyb3Ig aWYgSSBwdXQgX19kZWNsc3BlYyhkbGxleHBvcnQpIGtleXdvcmQgYmVmb3JlIHRoZSBteSB0ZW1w bGF0ZSBkZWZpbml0aW9uLiANCk15IHF1ZXN0aW9uIGlzIHdoZXRoZXIgaXQgaXMgc2FmZSBpZiBJ IGp1c3QgZGlzYWJsZSB0aGUgd2FybmluZy4gDQoNClRoZSB3YXJuaW5nIGlzOg0KIlRoZSBzcGVj aWZpZWQgYmFzZSBjbGFzcyB3YXMgbm90IGRlY2xhcmVkIHdpdGggdGhlIF9fZGVjbHNwZWMoZGxs ZXhwb3J0KSBrZXl3b3JkLkEgYmFzZSBjbGFzcyBvciBzdHJ1Y3R1cmUgbXVzdCBiZSBkZWNsYXJl ZCB3aXRoIHRoZSBfX2RlY2xzcGVjKGRsbGV4cG9ydCkga2V5d29yZCBpZiBhIGZ1bmN0aW9uIGlu IGEgZGVyaXZlZCBjbGFzcyBpcyB0byBiZSBleHBvcnRlZC4gIg0KLg0KVGhlIGNvZGUgaXM6DQp0 ZW1wbGF0ZTxjbGFzcyBUPiBteXRlbXBsYXRlDQp7DQogICAgVCB0Ow0KcHVibGljOg0KICAgIHZv aWQgU2V0RGF0YSggVCAmX3QgKXsgdCA9IF90OyB9DQp9Ow0KDQpjbGFzcyBNWURMTF9BUEkgTXlD bGFzcw0Kew0KICAgIG15dGVtcGxhdGU8aW50PiBkYXRhOw0KDQpwdWJsaWM6DQogICAgLi4uLg0K fTsNCg0KDQo= |
From: Nicolas R. <nic...@fr...> - 2002-08-05 12:23:54
|
Yes... template and DLLs are badly working together... Under VC7 you can at least declare the template exported... template<class T> class __declspec(dllexport) mytemplate { }; will correctly export the template. Note however that the export is only done on used template definitions... Export/import scheme defined automatically by VC++ is not sufficient... Let say you have a header containing: template<class T> class MYDLL_API mytemplate { }; A DLL is compiling with MYDLL_API to __declspec(dllexport). If it use it with T = MyDLLClass1 and MyDLLClass2, only mytemplate<DLLClass1> and mytemplate<DLLClass2> will be exported. If an external program is including the header (with MYDLL_API to __declspec(dllimport)) it won't be able to use the template for a "ExeClass" since it won't be exported by any DLL... Still havent find any way to correctly export the template itself (but using the #pragma warning(disable:xxxx) before using a non exported template). Nicolas. -----Original Message----- From: gam...@li... [mailto:gam...@li...]On Behalf Of jason zhang Sent: lundi 5 août 2002 09:48 To: gam...@li... Subject: [GD-Windows] dll export and template There was a compile warning when I use template in my export class of DLL. And the compiler will give an error if I put __declspec(dllexport) keyword before the my template definition. My question is whether it is safe if I just disable the warning. The warning is: "The specified base class was not declared with the __declspec(dllexport) keyword.A base class or structure must be declared with the __declspec(dllexport) keyword if a function in a derived class is to be exported. " . The code is: template<class T> mytemplate { T t; public: void SetData( T &_t ){ t = _t; } }; class MYDLL_API MyClass { mytemplate<int> data; public: .... }; N±ùµéX²²u¼)çYé¢g¢½é¶ÚþØHzGû©uëËÂ)£ j) ²Ñç¾X¶ÌÚ²X¶Ëº·~zwÛ³ÿ˲qç®zßËþX¶)£øç¾X¶ÌÚ° +²§ÿ¢êyúé·ùVr{÷®é®ét |
From: Julien K. <ma...@ju...> - 2002-08-05 16:37:23
|
Could you explain your Problem with this approach a little bit more precise ? Thanks Julien Koenen ----- Original Message ----- From: "Javier Arevalo" <ja...@py...> To: <gam...@li...> Sent: Monday, August 05, 2002 9:09 AM Subject: Re: [GD-Windows] Detecting mouse exiting window? > Julien Koenen <ma...@ju...> wrote: > > > You can Capture the Mouse-Cursor. > > Than you will get all Mouse-Move-Messages and you can check if the > > Mouse-Pos is still in your Window. > > > I strongly advise against this. It will hurt you later with usability > problems when the user wonders why his mouse doesn't seem to work properly. > > Javier Arevalo > Pyro Studios > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Brian S. <bs...@mi...> - 2002-08-05 16:45:20
|
If your app captures the mouse all the time, it makes it pretty hard for the user to click on other windows... Capturing the mouse seems most useful for processing things like custom buttons and drag-and-drop behaviors, where you need to get mouse down messages and mouse up messages in pairs. When they mouse down, you capture the mouse; when they mouse up, you release it. --brian > -----Original Message----- > From: Julien Koenen [mailto:ma...@ju...]=20 > Sent: Monday, August 05, 2002 9:36 AM > To: gam...@li... > Subject: Re: [GD-Windows] Detecting mouse exiting window? >=20 >=20 > Could you explain your Problem with this approach a little=20 > bit more precise > ? >=20 > Thanks >=20 > Julien Koenen >=20 > ----- Original Message ----- > From: "Javier Arevalo" <ja...@py...> > To: <gam...@li...> > Sent: Monday, August 05, 2002 9:09 AM > Subject: Re: [GD-Windows] Detecting mouse exiting window? >=20 >=20 > > Julien Koenen <ma...@ju...> wrote: > > > > > You can Capture the Mouse-Cursor. > > > Than you will get all Mouse-Move-Messages and you can check if the > > > Mouse-Pos is still in your Window. > > > > > > I strongly advise against this. It will hurt you later with=20 > usability > > problems when the user wonders why his mouse doesn't seem to work > properly. > > > > Javier Arevalo > > Pyro Studios |
From: Nicolas R. <nic...@fr...> - 2002-08-06 12:58:28
|
I guess the idea is: 1. To capture the mouse on first WM_MOUSEMOVE received by window (mouse enters) 2. To get each single mouse move message afterward.. Test if its outside of window.. If inside => 2 If outside => 3 3. Release mouse capture => 1 Nicolas. -----Original Message----- Brian Sharon Sent: lundi 5 aout 2002 18:45 Subject: RE: [GD-Windows] Detecting mouse exiting window? If your app captures the mouse all the time, it makes it pretty hard for the user to click on other windows... Capturing the mouse seems most useful for processing things like custom buttons and drag-and-drop behaviors, where you need to get mouse down messages and mouse up messages in pairs. When they mouse down, you capture the mouse; when they mouse up, you release it. --brian |
From: Javier A. <ja...@py...> - 2002-08-06 14:18:34
|
Nicolas Romantzoff <nic...@fr...> wrote: > 1. To capture the mouse on first WM_MOUSEMOVE received by window > (mouse enters) 2. To get each single mouse move message afterward.. > Test if its outside of window.. If inside => 2 > If outside => 3 > 3. Release mouse capture => 1 If you want to go ahead with that scheme, good luck... Remember: - Handle the WM_CAPTURECHANGED message - Check against the client rect so the the window controls (minimize, etc) work. - Release the mouse whenever the window (NOT the app - might be a child window) loses focus. - Make sure that all windows special keys work properly while the mouse is captured - not sure if mouse capture affects that. - Whenever in doubt, Release the mouse - if it's on the window you'll recapture it when it moves again. - Many other things I'm sure will go wrong. The polling solution may be a hack but at least it's a compliant way to overcome a limitation of Win95. Javier Arevalo Pyro Studios |