I've followed the steps outlined in the Help topic "Macro Activation" and the macro I'm trying to run doesn't run.
C++ code below. I am trying to invoke a macro whose nickname is "zquickly".
Has anybody actually done this?
Thanks,
Rich
#include <windows.h>
#include <stdio.h>
int main()
{
HWND handle = FindWindow(NULL, "Macro Express Player");
if(handle == NULL) {
printf("FindWindow returned NULL handle.\n");
exit(0);
}
// Invoke the desired macro by sending Windows messages.
// Evidently we're transmitting a NULL terminated string
// to the player program, character-by-character.
UINT nicknameConstant = WM_APP + 20;
char *macroname = "zquickly";
for(int pm = 0; pm < strlen(macroname); pm++) {
PostMessage(handle, nicknameConstant, macroname[pm], 0);
}
PostMessage(handle, nicknameConstant, 0, 0);
return 0;
}