It is currently Fri Jul 10, 2020 8:23 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject:
PostPosted: Sat Jun 30, 2001 5:55 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Paul.

Anyone know how to send keystrokes to another application?
I can set focus to an external app and even pull it out of the task bar if it's been minimized using:

handle.l=FindWindow_(0,"Window Name")
OpenIcon_(handle)
done.l=SetForegroundWindow_(handle)

But now that this window is in focus, how do I send some keystrokes to it like CTRL-R or any key for that matter?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jun 30, 2001 7:15 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Mr.Skunk.

Must go to bed :wink:, so don't have time to try, but perhaps this function will help you.

LRESULT SendMessage(

HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);


Mr Skunk


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 06, 2001 8:43 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Paul.

I still am unable to find a way to send keystrokes to external applications. I took a look at what you suggested but am having quite a time interpreting it.
Most other programming languages allow commands to find a window like: FindWindow_(0,"Untitled - Notepad"), open it up, and then use a command similar to:
SendKey("This is my text")
And it will type this into Notepad as if you used the keyboard.
(There are also special codes to send ALT, CTRL, ESC etc.)

Anyone have any ideas??


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 16, 2001 6:11 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by PB.

Quote:
I still am unable to find a way to send keystrokes to external applications


Check out the Beginner thread called 'Send a key to a window?' that I started, the solution is there. :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye