Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Make your program send commands to other programs ...
Author:
JP
E-mail:
Click to e-mail author
Submitted:
8/27/2000
Version:
VB5
Compatibility:
VB5, VB6
Category:
Miscellaneous
Views:
16817
Make your program send commands to other programs with less than 10 lines of code.
Declarations:
'none
Code:
AppActivate "---" SendKeys "---" These two statements are the only thing you need to send commands to other programs. An example using "Notepad": (It is important that the program is opened or else you'll get an error) AppActivate "Notepad" Sendkeys "%(f)" By putting Notepad in the quotes you are telling VB to let that program receive the focus. The "%" is the "Alt" key and so we are telling VB to move the focus to Notepad and to press the "Alt" key. The parentheses tell VB that while holding the "Alt" key it should press the "f" key. So if you try this code it will give the focus to Notepad and bring up its "File" menu. ***You can try out this code and fool around with it. If you have AOL you can try it with it too. ***
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement