For one, I can't seem to get a window by it's title as I supposedly should be able to. I know for sure what the title is, and am using the following command:
theTracker = FindWindowEx(NULL, NULL, NULL, "OpenMPT");
to try and grab the handle. However, it always returns NULL. My understanding is that this command should search every active window (including children), using the desktop as the parent, for a window with the title of "OpenMPT". However, it never finds anything.
Turning instead to the PostMessage() function, I tried to post to the 'current thread' by replacing the handle parameter with NULL as described here. Also doesn't seem to work.
The messages I'm trying to send are found in a message map, which I reproduce here:
BEGIN_MESSAGE_MAP(CTrackApp, CWinApp)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_FILE_NEWMOD, OnFileNewMOD)
ON_COMMAND(ID_FILE_NEWS3M, OnFileNewS3M)
ON_COMMAND(ID_FILE_NEWXM, OnFileNewXM)
ON_COMMAND(ID_FILE_NEWIT, OnFileNewIT)
ON_COMMAND(ID_NEW_ITPROJECT,OnFileNewITProject)
ON_COMMAND(ID_NEW_MPT, OnFileNewMPT)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_HELP_INDEX, CWinApp::OnHelpIndex)
ON_COMMAND(ID_HELP_FINDER, CWinApp::OnHelpFinder)
ON_COMMAND(ID_HELP_USING, CWinApp::OnHelpUsing)
ON_COMMAND(ID_HELP_SEARCH, OnHelpSearch)
END_MESSAGE_MAP()
I am trying to Post or SendMessage() with the ID_FILE_NEW message. Can't get it to work.
One final question: is ID_FILE_NEW the actual message name? It seems it should be, but I thought maybe Windows might append some other prefix to it?
Any help, even a pointer to some nice reading on this stuff, would be great.