- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try to use systemqq
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page