|
-
Jul 7th, 2000, 09:07 AM
#1
Thread Starter
New Member
My only access to the window is through SendMessage. I am able to post any text, now I want to simulate keys...
1) I can't send any ENTER key character to the edit control.
2) Is it possible in any way to simluate i.e. ALT+R?
Best Regards,
Yves
-
Jul 8th, 2000, 01:50 AM
#2
New Member
1) to send ENTER to the edit control, you should just find the character for enter.......i think it might be chr(10) or maybe even chr(12)
send this text to the edit control:
"Line 1" & chr(10) & "Line 2"
2) i'm assuming that by sending Alt-R, you are trying to get into a menu....to do that use the GetMenu and GetSubMenu functions
-
Jul 9th, 2000, 06:17 AM
#3
Thread Starter
New Member
1) I tryed both and even the vbNewline one, they don't work! Else I would not have asked...
2) I am trying to run a Keyboard Express macro using ALT+R... Is there a way to simulate keys so that this would be possible?
Best Regards,
Yves
-
Jul 9th, 2000, 10:00 AM
#4
Try using the keybd_event or SendInput API.
-
Jul 12th, 2000, 04:25 AM
#5
Thread Starter
New Member
I am using SendMessage(hwnd, WM_CHAR, 13, 0) to send the Return key! Did not try but maybe I can simulate ALT+R the same way!
Best Regards,
Yves
-
Jul 19th, 2000, 04:12 AM
#6
New Member
USE THIS CODE
Option Explicit
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Private Const VK_ENTER = &HD
Private Const KEYEVENTF_KEYUP = &H1
Private Sub Form_Load()
Form1.Visible = False
Dim VK_ACTION As Long
VK_ACTION = &H52
Call keybd_event(VK_ACTION, 0, 0, 0)
Call keybd_event(VK_ALT, 0, 0, 0)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|