[2005] How to send "Enter"
How can I send to application "Enter", or other keys? I mean:
Code:
Dim hwnd As Int32 = FindWindow("Notepad", Nothing)
If Not hwnd = 0 Then
hwnd = FindWindowEx(hwnd, 0, "edit", Nothing)
If Not hwnd = 0 Then
SendMessage(hwnd, WM_PASTE, 0, 0)
End If
End If
I won't "paste" something, but send key like "Enter" or "Esc".
Re: [2005] How to send "Enter"
Code:
SendKeys.Send("{ENTER}")
Re: [2005] How to send "Enter"
I need to send win mesasge, not use sendkeys (target window can be hidden).
Re: [2005] How to send "Enter"
Make your window so that when it is 'hidden' it doesn't hide it completely.
Make the window Top and Left greater than the screen size so it is offscreen.
Then the user cannot see it, but it can still have SendKeys.Send("{}") sent to it.
Example:
Code:
Dim intLeft As Integer = Screen.PrimaryScreen.Bounds.Width + 10
Dim intTop As Integer = Screen.PrimaryScreen.Bounds.Height + 10
Me.Left = intLeft
Me.Top = intTop
That will make it like this:
http://aycu19.webshots.com/image/442...8501011_rs.jpg
Re: [2005] How to send "Enter"
It's not a solution. If somebody is using PC at that moment, my app will take focus for a while. I need app. working hidden, without disturbing users (I wrote something like you described, but it's really wrong way to send keys to app.).