[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

BeeJ

5/23/2012 10:51:00 PM

I need to hook the mouse system wide (off my app) to see the mouse X &
Y values only over the entire screen area.

I have tried all kinds of options for SetWindowsHookEx and found that
it does not work for NT/2000 on if the call is in the main app. It
does work for the area of the app itself but that won't meet my needs.

So far all I can find is that a .DLL is required.
I have coded the .DLL style app and it does work however I need to have
all the code contained in the main .EXE with no other .DLL or
otherwise.

Is this possible or am I stuck with using a .DLL?
I do not like having a .DLL that exposes such system wide access.
Maybe I just do not know the terminology to search for.

--
So where are we?
Not the street address.
Not the city.
Not the country.
Not the Earth.
Not the Solar System.
Not the Galaxy.
Not the Universe.
Not the Brane.
So where is the Brane?
Where are we?

Life is but a dream!


8 Answers

unknown

5/24/2012 1:57:00 AM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:jpjpk7$54m$1@speranza.aioe.org...
>I need to hook the mouse system wide (off my app) to see the mouse X & Y
>values only over the entire screen area.
>
> I have tried all kinds of options for SetWindowsHookEx and found that it
> does not work for NT/2000 on if the call is in the main app. It does work
> for the area of the app itself but that won't meet my needs.
>
> So far all I can find is that a .DLL is required.
> I have coded the .DLL style app and it does work however I need to have
> all the code contained in the main .EXE with no other .DLL or otherwise.
>
> Is this possible or am I stuck with using a .DLL?
> I do not like having a .DLL that exposes such system wide access.
> Maybe I just do not know the terminology to search for.

Why not use GetCursorPos?

You are correct that a DLL is required, but I think in some hook types it's
not, like WH_MOUSE_LL. However, one disadvantage for global hooks is that
some anti-virus software could block the global hook, so you wouldn't get
messages to say the least.


BeeJ

5/24/2012 3:48:00 PM

0

Farnsworth used his keyboard to write :
> "BeeJ" <nospam@spamnot.com> wrote in message
> news:jpjpk7$54m$1@speranza.aioe.org...
>>I need to hook the mouse system wide (off my app) to see the mouse X & Y
>> values only over the entire screen area.
>>
>> I have tried all kinds of options for SetWindowsHookEx and found that it
>> does not work for NT/2000 on if the call is in the main app. It does work
>> for the area of the app itself but that won't meet my needs.
>>
>> So far all I can find is that a .DLL is required.
>> I have coded the .DLL style app and it does work however I need to have all
>> the code contained in the main .EXE with no other .DLL or otherwise.
>>
>> Is this possible or am I stuck with using a .DLL?
>> I do not like having a .DLL that exposes such system wide access.
>> Maybe I just do not know the terminology to search for.
>
> Why not use GetCursorPos?
>
> You are correct that a DLL is required, but I think in some hook types it's
> not, like WH_MOUSE_LL. However, one disadvantage for global hooks is that
> some anti-virus software could block the global hook, so you wouldn't get
> messages to say the least.

Put inside a timer and it works just as needed GetCursorPos.
Thanks. Even better than hooking and simpler.


Jeff Johnson [MVP: VB]

5/24/2012 3:48:00 PM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:jpjpk7$54m$1@speranza.aioe.org...

>I need to hook the mouse system wide (off my app) to see the mouse X & Y
>values only over the entire screen area.

"Only" over the "entire screen area"? What else is there?


BeeJ

5/24/2012 6:53:00 PM

0

Jeff Johnson expressed precisely :
> "BeeJ" <nospam@spamnot.com> wrote in message
> news:jpjpk7$54m$1@speranza.aioe.org...
>
>>I need to hook the mouse system wide (off my app) to see the mouse X & Y
>> values only over the entire screen area.
>
> "Only" over the "entire screen area"? What else is there?

Are you an English speaker?
Only X, Y. Do not need mouse clicks. Not just over the app but over
the whole screen or desktop.


MikeD

5/24/2012 7:35:00 PM

0



"BeeJ" <nospam@spamnot.com> wrote in message
news:jpm02f$915$1@dont-email.me...
> Jeff Johnson expressed precisely :
>> "BeeJ" <nospam@spamnot.com> wrote in message
>> news:jpjpk7$54m$1@speranza.aioe.org...
>>
>>>I need to hook the mouse system wide (off my app) to see the mouse X & Y
>>>values only over the entire screen area.
>>
>> "Only" over the "entire screen area"? What else is there?
>
> Are you an English speaker?
> Only X, Y. Do not need mouse clicks. Not just over the app but over the
> whole screen or desktop.
>
>

It's the way you originally wrote it. It could have been taken 2 ways. One
with the word "only" emphasizing "X & Y values" and the other way with the
word "only" emphasizing "over the entire screen area". Jeff took it as the
latter. Proper use of punctuation would have prevented this.

Mike


Mike Williams

5/24/2012 7:51:00 PM

0


"BeeJ" <nospam@spamnot.com> wrote in message
news:jpm02f$915$1@dont-email.me...
> Jeff Johnson expressed precisely :
>>> "BeeJ" <nospam@spamnot.com> wrote in message
>>> news:jpjpk7$54m$1@speranza.aioe.org...
>>> I need to hook the mouse system wide (off my app) to see
>>> the mouse X & Y values only over the entire screen area.
>>
>> "Only" over the "entire screen area"? What else is there?
>
> Are you an English speaker?

Actually I think that Jeff might bounce that question back at you, BeeJ. The
word "only" in your original question is in fact technically redundant, but
if you wish to include it and if you wish to apply it to the phrase "the
mouse X and Y values" rather than the phrase "the entire screen" then you
need to include it in the correct place, as follows:

"I need to hook the mouse system wide to see only
the mouse X & Y values over the entire screen area".

;-)

Mike





BeeJ

5/24/2012 11:44:00 PM

0

Mike Williams wrote on 5/24/2012 :
> "BeeJ" <nospam@spamnot.com> wrote in message
> news:jpm02f$915$1@dont-email.me...
>> Jeff Johnson expressed precisely :
>>>> "BeeJ" <nospam@spamnot.com> wrote in message
>>>> news:jpjpk7$54m$1@speranza.aioe.org...
>>>> I need to hook the mouse system wide (off my app) to see
>>>> the mouse X & Y values only over the entire screen area.
>>>
>>> "Only" over the "entire screen area"? What else is there?
>>
>> Are you an English speaker?
>
> Actually I think that Jeff might bounce that question back at you, BeeJ. The
> word "only" in your original question is in fact technically redundant, but
> if you wish to include it and if you wish to apply it to the phrase "the
> mouse X and Y values" rather than the phrase "the entire screen" then you
> need to include it in the correct place, as follows:
>
> "I need to hook the mouse system wide to see only
> the mouse X & Y values over the entire screen area".
>
> ;-)
>
> Mike

Thanks all for the hellp.

--
Noah's Ark was built by amateurs,
The Titanic was built by professionals.
Row, row, row your boat gently down the stream ...
Life is but a dream!


Mike Williams

5/25/2012 6:02:00 AM

0

"BeeJ" <nospam@spamnot.com> wrote [sarcastically]
in message news:jpmh4e$mae$1@dont-email.me...
>
> Thanks all for the hellp.

You're wellcome ;-)

Mike