Problem- SendKey CTRL+R + M

N

ngeluis

Hello every one..
Im having problems to send a command to Windows - Run...
I want to send a command to Windows - Run to the people only have to
press the Enter Key...

The text that i want to send to Windows - Run is like this -> B:
\setup.exe +uAEKLX +pc:\TEAMSTM

I can do it but if i use my .net code and Vbs... but i wanted to use
only .net
Sorry for my english and my poor explanation... im 3 days looking for
solution and till today nothing found...
Thanks in advance...


Here it is the code...
Const VK_STARTKEY = &H5B
Const VK_M = 77
Const KEYEVENTF_KEYUP = &H2
Const VK_R = Asc("r") '&H52
Const VK_LWin = &H5B

Const VK_CTRL = 17
Const VK_ESQ = 27

keybd_event(VK_STARTKEY, 0, 0, 0)
keybd_event(VK_M, 0, 0, 0)
keybd_event(VK_M, 0, KEYEVENTF_KEYUP, 0)
keybd_event(VK_STARTKEY, 0, KEYEVENTF_KEYUP, 0)


''<--- CTRL + ESQ ---->
keybd_event(VK_CTRL, 0, 0, 0)
keybd_event(VK_ESQ, 0, 0, 0)
keybd_event(VK_CTRL, 0, KEYEVENTF_KEYUP, 0)
keybd_event(VK_ESQ, 0, KEYEVENTF_KEYUP, 0)

keybd_event(VK_R, 0, 0, 0)
 
L

Lloyd Sheen

Hello every one..
Im having problems to send a command to Windows - Run...
I want to send a command to Windows - Run to the people only have to
press the Enter Key...

The text that i want to send to Windows - Run is like this -> B:
\setup.exe +uAEKLX +pc:\TEAMSTM

I can do it but if i use my .net code and Vbs... but i wanted to use
only .net
Sorry for my english and my poor explanation... im 3 days looking for
solution and till today nothing found...
Thanks in advance...


Here it is the code...
Const VK_STARTKEY = &H5B
Const VK_M = 77
Const KEYEVENTF_KEYUP = &H2
Const VK_R = Asc("r") '&H52
Const VK_LWin = &H5B

Const VK_CTRL = 17
Const VK_ESQ = 27

keybd_event(VK_STARTKEY, 0, 0, 0)
keybd_event(VK_M, 0, 0, 0)
keybd_event(VK_M, 0, KEYEVENTF_KEYUP, 0)
keybd_event(VK_STARTKEY, 0, KEYEVENTF_KEYUP, 0)


''<--- CTRL + ESQ ---->
keybd_event(VK_CTRL, 0, 0, 0)
keybd_event(VK_ESQ, 0, 0, 0)
keybd_event(VK_CTRL, 0, KEYEVENTF_KEYUP, 0)
keybd_event(VK_ESQ, 0, KEYEVENTF_KEYUP, 0)

keybd_event(VK_R, 0, 0, 0)

I guess the first question is why are you using the Windows run when you can
use the Process class to start any process you want. If you want there to
be a GUI element simply show a dialog with the command to run and let the
user click the Enter key to start the process.

Hope this helps
Lloyd Sheen
 
N

ngeluis

I guess the first question is why are you using the Windows run when you can
use the Process class to start any process you want.  If you want there to
be a GUI element simply show a dialog with the command to run and let the
user click the Enter key to start the process.

Hope this helps
Lloyd Sheen- Ocultar texto citado -

I forgot to explain that part.. of corse i can use Shell or process
call like you said, but im emulating the Framework 2.0 with Thinstall,
and Thinstall have a problem that is... you cannot run any setup.exe
with your application because or it gives a error or it block the
setup... i have sended a email to them but still didnt get the answer
for my problem...
Every application i tell my application to execut Thinstall copy that
application and b00m problem...

So till my company gives the order to all laptops have FW 2.0 that
come here to install our software i must simplify to the maximum the
installations....

So thats why im not using shell or process.start .... and im sending
KeySends because that my application cannot grab and use it :p

Anyway.... Yesterday i have fixed my problem with...
Const VK_LWIN = &H5B
Const KEYEVENTF_KEYUP = &H2
Const VK_APPS = &H5D
Const VK_DELETE = &H2E

Dim VK_ACTION = &H52

Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(VK_ACTION, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)

But to sendkey with the text "B:\setup.exe" im having problems...
some times the app sends some times he dont send...
any clue ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top