Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Control an application Program in CVF

eternity72
Beginner
504 Views
Hi, there
I'm trying to control an application program(ex. notepad, Ansys) in Fortran.
In VBA, there is a command like sendkeys to control menu of an application program. Is there anycommand like sendkeys of VBA in Fortran?
Following is atest program written in VBAto control menu of notepad.
....
SendKeys "%f" ' file of menu
SendKeys "%n" ' new of file
....
Thanks.
Jong-Ha Jun
0 Kudos
2 Replies
Zhanghong_T_
Novice
504 Views
try to use systemqq
0 Kudos
Jugoslav_Dujic
Valued Contributor II
504 Views
See keybd_event function (interface not provided in DFWIN for unknown reasons):
Note that, in order that it works, the Notepad's window has to be the foreground window (as keybd_event/SendKeys only simulates the keypress, so it will have the same effect). Also, don't forget to send appropriate "key up" events so that the keyboard driver does not get confused.
(The issue of controling other programscan be verycomplex, because it's basically a cludge method which does not work for each application in the same way.)
Note that Notepad is basically just a multi-line edit control with few menu options, so it'srelatively easy to "roll your own""Notepad simulator" within your application (if that's the goal).
Jugoslav
0 Kudos
Reply