Yeah I was thinking that to use that code to activate it because you'd want it to be activated by key press.
Originally Posted by Jorndel
Erm, you know that stimulate a key press for applications don't need your program to be on the top?
It would be like making and AHK script and run it...
If he gets the point of SendKeys.Send("Key Code")
It stimulates a keyboard input, to the selected / active application.
Which would be CS in this case.
Else it would just write space to the text document. (Or W/E he uses it on)
The SendMessage is used to send messages to the applications without having em active.
(Think I also used it for reading as well...)
But point is: It would also stimulate a key-press as well. (If the info provided allows it)
[hl][/hl]
Kinda want a bit away from what you said but...
You have a function that will register any key pressed, and you can make that in a timer.
To detect if the key you want to activate the "script" was/are pressed.
Using this:
Code:
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> Public Shared Function GetAsyncKeyState(ByVal vkey As Keys) As Boolean
End Function
And adding that in a timer and do this: SendKeys:
Code:
If GetAsyncKeyState = Keys.F1 Then SendKeys.Send(" ")