The 450XX command codes, corresponding to the keystrokes 0-9 overlaid with various combinations of Ctrl, Alt, and Shift, work fine for user commands but are apparently ignored for macros. I assign a command the hotkey Alt+1 and 45011 will trigger it. I assign a macro the hotkey Alt+2 and 45012 does nothing. I hope the problem is that I am doing something wrong and that this is not by design. Pointers? Thanks.
[What follows is an edit.]
Actually, I think now that the 450XX is working but the macro is not. The macro I am testing is one of the sample ones:
Code: Select all
FINDWND address
FINDCLASS combobox
SETTEXT "c:\"
SENDKEY enter
The address bar does get set to "c:\", but the enter key never gets pressed. I can't make enter work. And that is the real nub of my problem. If I execute this macro by using the context menu, the enter works. If I send the 45013 code, the enter does not work. So I think the problem I am seeing is that the enter command does not work unless the keyboard itself is used to start the macro (using the menu to get to it or the shortcut key assigned to it). There does not seem to be a way to automate an enter unless the X2 window is actually the active window. So I'll go away quietly now.
But what I would like to be able to do is to cause an X2 window, whose handle I know. to browse into an arbitrary directory specified on the fly. What I thought to do is to set that directory name into the address bar, and then use the macro to send enter. Activating the window with code is not always successful, as Windows is running stuff asynchronously. Would welcome a pointer to a guaranteed successful method. It does seem to me, though, that the X2 macro line "SENDKEY ENTER" ought to do what it says if it is talking to itself.