473,323 Members | 1,574 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,323 software developers and data experts.

C# Send Mouseclick to Window

Is there a way to send mouseclick to an inactive window? My guess would be to use the Win32 API function PostMessge(). I tried to do this and it seems like that it may be sending the mouse click but I think the coordinates are with respect to the top left of the desktop and not the top left of the hWnd that I send as a parameter.
Feb 1 '09 #1
2 7471
Plater
7,872 Expert 4TB
I think you might be correct?
You will probably have to dig around for functions that tell you were the window is and do some conversions then?

Can you devise a test setup to find out what itse doing?
Perhaps make a program with a single form that registers mouse clicks and displays their coordinates.
Then you could post your click message to it and see where it thinks the mouse is clicking?
Feb 2 '09 #2
So apparently the coordinates that you supply in PostMessage() are with respect to the hWnd that you also supply. I just was supplying bad coordinates for the click because of a typo.
Feb 3 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: BadOmen | last post by:
I want my program to send a mouse click to the window at the current mouse position, how do I do that? Example: I have my mouse over a button in Word and then my program is sending the left...
6
by: Terje Johan Abrahamsen | last post by:
Hello. I have been trying desperately for a while to make Python push the left mousebutton. I have been able to let Python push a button in a box: def click(hwnd): win32gui.SendMessage(hwnd,...
9
by: Etienne Charland | last post by:
Hi, there is an application running on a remote desktop (under Citrix ICA, but the same problem applies for RDC or PC Anywhere). Now, I want to send keys to the remote application from a local app....
15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
4
by: Peter Rilling | last post by:
What is the difference between the MouseClick and Click events?
4
by: Chris Dunaway | last post by:
I added a MouseClick event to a Button control. It responds properly to the Left click of the button, but not a middle click or right click. Is it possible to get a right click and/or middle...
6
by: Kristian Frost | last post by:
Hi, I'm trying to add, as you might guess, mouseclick listeners to the shapes I am drawing using the GDI+ commands in a similar sort of way as could be done with the old VB "shapes". Problem is,...
2
by: GS | last post by:
how can I tell if it is right mouse click from left mouseclick? I would also to test if a key like control is being held down at the same time. what I would really like to is to capture control...
6
by: RolltheBall | last post by:
Hi there. I am trying to make a certain symbol to appear upon every mouseclick. However, the symbol is a cross and an arrow head. This is how I tried to do it. Private Sub Form1_Paint(ByVal...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.