|
-
Jul 8th, 2005, 04:22 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] SendKeys
Hello, Im using the sendkeys function to send keys to another program, it works ok when I use letters, but if i use a symbol it wont work, heres an example of what i meen.
VB Code:
SendKeys "Send keys function" 'this would work ok
SendKeys ":)" ' this wouldnt work
Does anyone know why this is? and is there a way around it
-
Jul 8th, 2005, 04:37 PM
#2
Hyperactive Member
Re: SendKeys
Hello,
The only character that don't work with the sendkey function is the two ")" "(" And these two Characters "{}"
So if you keep those four types of characters out of the code it seems to work.
Hope this helps ya!
Stikid007
 Originally Posted by stilekid007
-
Jul 8th, 2005, 04:40 PM
#3
Re: SendKeys
Because the program is not expecting a symbol, so it doesn't know to convert it.
-
Jul 8th, 2005, 05:11 PM
#4
Re: SendKeys
Certain "symbols" have special meanings to SendKeys, like % means the Alt key, ~ is the Enter key, etc.
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 
-
Jul 8th, 2005, 06:17 PM
#5
Re: SendKeys
Here is a list of all symbols that I had to deal with specially when making a program using SendKeys:
(){}%&~+^
Tha box is ALT+0127. Also, ASCII # 0173 has problems if used with sendkeys in a rich text box. Good luck
-
Jul 8th, 2005, 08:04 PM
#6
Re: SendKeys
If your having allot of troubles with SendKeys (usually everyone has issues with it) you should maybe consider changing
over to FindWindow, FindWindowEx, & SendMessage APIs for reliability and none of these type of issues.
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 
-
Jul 8th, 2005, 08:23 PM
#7
Hyperactive Member
Re: SendKeys
If you want to get around this problem of VB not recognizing it becuase of its character then you could do this.
VB Code:
SendKeys "+9" 'Presses SHIFT plus 9 resulting in "("
Give it a try and let me know what you think.
The "+" = "SHIFT KEY"
Stilekid007
 Originally Posted by stilekid007
-
Jul 9th, 2005, 08:31 AM
#8
Thread Starter
Hyperactive Member
Re: SendKeys
yup worked fine stilekid007 thanks
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
|