Is there any more detail on the second "method which uses a copydata struct passed to the window of the program"?
The transmit.exe bundled with the latest winlirc uses the this method.
The source is essentially just this
#include <windows.h>
#include <stdio.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LRESULT copyDataResult;
HWND pOtherWnd = FindWindow(NULL, "WinLirc");
if (pOtherWnd)
{
COPYDATASTRUCT cpd;
cpd.dwData = 0;
cpd.cbData = strlen(lpCmdLine);
cpd.lpData = (void*)lpCmdLine;
copyDataResult = SendMessage(pOtherWnd,WM_COPYDATA,(WPARAM)hInstance,(LPARAM)&cpd);
// copyDataResult has value returned by other app
}
else
{
return 1;
}
return 0;
}
I know that winlirc doesn't support send once. But, you are welcome to change the source of winlirc yourself and add it. I'll probably want to merge that with the main code sometime in the future.