![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 18
Rep Power: 0
![]() |
Clicking buttons on other Apps
I have to have my application click on the buttons of another application, and currently I'm using the following method:
PostMessage(button-HDC, WM_LBUTTONDOWN, 0, 0); System.Threading.Thread.Sleep(150); PostMessage(button-HDC, WM_LBUTTONUP, 0, 0); This works just fine, except that, occasionally, the other application (not my application, the application whose buttons are being pressed) locks up and crashes after my application pushes one of its buttons. So I was trying to find another way to do this, perhaps by posting a different sort of message, using mouse events, or perhaps something like simulate-mouse-click(position-x, position-y); I'm not quite sure how to do this, however. Any advice would be appreciated. Thanks! |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
That looks like C# code. As a matter of fact, isn't this a cross post???? If you feel you chose the wrong forum, you should ask a mod to move it appropriately.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 18
Rep Power: 0
![]() |
Sorry about that--yes this is a cross post, and yes I'm actually programming in C#. It's just that apparently no one can help me with this in the C# forum, so I thought I'd post it here, since like 10 times as many people come to the C++ forum than the C# forum.
|
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
If someone can help someone else with a C# problem, they'll go to the C# forum. It's a law of Nature. Now stop meddling with Nature and leave it be!
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|