|
|
#1 |
|
Junior Member
Join Date: Mar 2008
Location: France
Posts: 2
|
How to Send Keys with NSIS?
Hello,
I use NSIS to compile launchers for portable applications and I want to simulate key strokes as done by: AutoIt code: or VBScript code: Is there some plugins or code to do this with NSIS? Thanks in advance for answer. |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
|
For pre-defined stdin string http://nsis.sourceforge.net/ExecCmd_plug-in may help
|
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Mar 2008
Location: France
Posts: 2
|
@ Afrow UK
Thanks for your quick reply. I think that keybd_event is my solution and I will study your link. @ Takhir Thanks also for your quick reply. Your plugin is interesting for me because I want also send a string to an input field. If I succeed in a script I will post in this topic. |
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
|
Please note that for keybd_event() or SendInput() your application should 1) be detached from installer (use Exec, not ExecWait or nsExec); 2) be visible; 3) have keyboard focus (to be restored before every char). For last point you need window handle. May be I forgot something else...
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jun 2008
Location: UK
Posts: 9
|
Did anyone manage to get SendInput working?
I've attempted to write the code but it's coming back with error 87: System::Call '*(i1,i9,i0,i1) i.R0' System::Call "User32::SendInput(i1,iR0,i1)?e" Pop $R1 Detailprint $R1 System::Free $R0 I'm trying to send a Tab. |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
Use keybd_event. Easier to implement and it should still work on Vista.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jun 2008
Location: UK
Posts: 9
|
Unfortunately keybd_event doesn't work with TS RemoteApps, I desperately need SendInput.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|