Category : Files from Magazines
Archive   : VOL10N18.ZIP
Filename : MYSEND.KEY

 
Output of file : MYSEND.KEY contained in archive : VOL10N18.ZIP
Declare Function GetFocus Lib "user" As Integer

Declare Sub PostMessage Lib "user" (hWnd As Integer, \
wMsg As Integer, wParam As Integer, lParam As Long)

Declare Sub SendMessage Lib "user"(hWnd As Integer, \
wMsg As Integer, wParam As Integer, lParam As Long)

Sub MySendKeys(keys$, wait)
focus = GetFocus
wmChar = 258 ' WM®MDNM¯CHAR is Windows®MDUL¯®MDNM¯ message #258
s$ = keys$
While Len(s$) > 0
ch$ = Left$(s$, 1) ' get next character
s$ = Right$(s$, Len(s$) - 1) ' remove it
If ch$ = "~" Then
c = 13 ' {enter}
Else
c = Asc(ch$)
End If
Print c, s$ ' watch keys fly by on status bar
If wait = 0 Then
PostMessage focus, wmChar, c, 0
Else
SendMessage focus, wmChar, c, 0
End If
Wend
End Sub

Sub MAIN
Shell "notepad"
MySendKeys "this is a test of MySendKeys~", 0
End Sub


  3 Responses to “Category : Files from Magazines
Archive   : VOL10N18.ZIP
Filename : MYSEND.KEY

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/