Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 2nd, 2005, 1:41 AM   #1
Mechromancer
Newbie
 
Mechromancer's Avatar
 
Join Date: Apr 2005
Posts: 18
Rep Power: 0 Mechromancer is on a distinguished road
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!
Mechromancer is offline   Reply With Quote
Old Jul 2nd, 2005, 6:25 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Jul 2nd, 2005, 11:06 AM   #3
Mechromancer
Newbie
 
Mechromancer's Avatar
 
Join Date: Apr 2005
Posts: 18
Rep Power: 0 Mechromancer is on a distinguished road
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.
Mechromancer is offline   Reply With Quote
Old Jul 2nd, 2005, 11:48 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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!
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC