|
-
Dec 25th, 2004, 05:42 PM
#1
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
Is this what you need, thegreatone?
VB Code:
Private Sub Command1_Click()
Dim i%
Shell "notepad", vbNormalFocus
Clipboard.Clear
With Text1
For i = 0 To Len(.Text) - 1
SendKeys Mid(.Text, i + 1, 1)
Next i
End With
SendKeys "^{c}"
SendKeys "^{v}"
End Sub
-
Dec 25th, 2004, 09:17 PM
#2
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
i don't think he is talking about notepad. not sure what it is, though
-
Dec 25th, 2004, 10:17 PM
#3
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
 Originally Posted by dglienna
i don't think he is talking about notepad. not sure what it is, though
... then what would this mean? ...
VB Code:
Private Appnum As Long
Private Sub Command1_Click()
Appnum = Shell("C:\WINDOWS\notepad.exe")
Timer2.Enabled = True
End Sub
-
Dec 25th, 2004, 11:04 PM
#4
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
BUT, when modified to open another app it DOES send the keys, BUT as the other app ONLY responds to real keyboard shortcuts how do i make it act as if it came from the keyboard ?
AND
...same signal as the one runnin down the ps/2 port
I wasn't sure what he meant, either.
-
Dec 25th, 2004, 11:07 PM
#5
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
I guess we just have to wait until he responds ...
-
Dec 25th, 2004, 11:23 PM
#6
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
You can use the keybd_event API to send keypreses or mouseclicks to
a window that you can make active and focused.
VB Code:
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
An example at allapi.net
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 26th, 2004, 11:34 AM
#7
Thread Starter
Frenzied Member
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
Sorry i took so long to reply, so far the closest thing to what i am trying to do is posted by robdog, BUT i am still far from acheiving what i am wanting to do.
Ok, i am really trying to make this understandable, so here goes :
When you press a key on your keyboard a signal is sent through the wire to the computer, i want a Visual Basic program to be able to simulate that exact thing. This program MUST be able to make the computer think a key is bieng pressed somehow, and the API and sendkeys features do not do this. Am i aiming far too high for a VB program ?
-
Dec 26th, 2004, 06:11 PM
#8
Re: Fixed code, still need help tho... SIMULATE REAL KEYBOARD COMMANDS
Checkout the example (keyboard animation) for SetKeyboardState API here.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|