473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How to check current mouse position is desktop window?

Hi,

I create a system mouse hook, to get mouse position and click events.
use GetDesktopWiindow and WindowFromPoint(x,y) to get window handle in my
hook proc.
Click mouse on desktop window and print the window handle which i got in
hook proc.
GetDesktopwindow() == 65557;
WindowFromPoint(x,y) == 65700;
but when i use spy++ to get the desktop window handle, it's return 0x100A4
or 0x100A2.
what's matter?

best wish,

harvie

2006-6-27
Jun 27 '06 #1
3 10908
0x100A4 is a hexadecimal presentaion of the 65700
Hi,

I create a system mouse hook, to get mouse position and click events.
use GetDesktopWiindow and WindowFromPoint(x,y) to get window handle in my
hook proc.
Click mouse on desktop window and print the window handle which i got in
hook proc.
GetDesktopwindow() == 65557;
WindowFromPoint(x,y) == 65700;
but when i use spy++ to get the desktop window handle, it's return 0x100A4
or 0x100A2.
what's matter?


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Jun 27 '06 #2
Hello Michael,
thanks!
why GetDesktopWindow return window handle do not equal to WindowFromPoint(x,y)?
I click the mouse on desktop.

harvie

2006-6-27
0x100A4 is a hexadecimal presentaion of the 65700
Hi,

I create a system mouse hook, to get mouse position and click events.
use GetDesktopWiindow and WindowFromPoint(x,y) to get window handle
in my
hook proc.
Click mouse on desktop window and print the window handle which i got
in
hook proc.
GetDesktopwindow() == 65557;
WindowFromPoint(x,y) == 65700;
but when i use spy++ to get the desktop window handle, it's return
0x100A4
or 0x100A2.
what's matter?

"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

Jun 27 '06 #3
Hello Michael,

Is the desktop window handle a const value (100A4)?
why GetDesktopwindow can not return the correct value?
0x100A4 is a hexadecimal presentaion of the 65700
Hi,

I create a system mouse hook, to get mouse position and click events.
use GetDesktopWiindow and WindowFromPoint(x,y) to get window handle
in my
hook proc.
Click mouse on desktop window and print the window handle which i got
in
hook proc.
GetDesktopwindow() == 65557;
WindowFromPoint(x,y) == 65700;
but when i use spy++ to get the desktop window handle, it's return
0x100A4
or 0x100A2.
what's matter?

"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

Jun 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Joshua Weston | last post by:
I am new to C++ and I am very interested in becoming proficient. This post is two-fold. One, I am having problems with this small test program. It is meant to allow user input to control a "@"...
9
by: punkin | last post by:
I am trying to catch mouse position on the entire screen by dynamically generating mouse click event at every 100 ms. My code only works for IEs but not any Netscape or Gecko-based browsers. The...
7
by: Larry R Harrison Jr | last post by:
I am looking for javascript and a basic tutorial on how to make mouse-over drop-down menus--the type that when you "hover" over a subject links relevant to that subject "emerge" which you can then...
6
by: lauren quantrell | last post by:
I have a command button on a continuous subform and I want the user to click it to open a small popup form that opens in the position of the mouse (which is the same as the position of the command...
4
by: atn2002 | last post by:
How can I track the mouse coordinates outside the active window? No one can tell me its not possible because Google Spreadsheets and EditGrid both do it. When you drag down to select cells these...
3
by: Doug | last post by:
Hi I am trying to find a way to make the mouse cursor move to the keyboard cursor position in an application. For example, I use an application called Enterprise Guide, and I control this...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.