C
Habs jetzt mal so versucht, geht aber auch nicht????
Die EXE welche ich aufrufe ist Von mir erstellt.
....
int main( int argc, char *argv[] )
{
MSG lpMsg;
UINT wMsgFilterMin, wMsgFilterMax;
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
CreateProcess( "D:\\Temp\\hwnd.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
Sleep(999); //Sonst findet er das Fenster nicht!!
HWND hCMD = FindWindow( NULL, "Alle Dialoge!" );
if( !hCMD ) printf( "Das Fenster wurde nicht gefunden!\n" );
printf( "hCMD <%d> \n", hCMD);
while( 1 ) {
BOOL gm;
wMsgFilterMin = 0;
wMsgFilterMax = 0;
gm = PeekMessage( &lpMsg, hCMD, wMsgFilterMin, wMsgFilterMax, PM_NOREMOVE );
// lpMsg
// [out] Pointer to an MSG structure that receives message information from
// the thread's message queue.
//
// hWnd
// [in] Handle to the window whose messages are to be retrieved.
// [>] The window must belong to the calling thread. [<] The following
// value has a special meaning.
Sleep(999);
if(!gm) {
printf( "wMsgFilterMin <%d> \t , wMsgFilterMax <%d> \n gm <%d>\n",
wMsgFilterMin, wMsgFilterMax, gm );
printf( "lpMsg.hwnd <%d>\n", lpMsg.hwnd );
printf( "lpMsg.message <%d>\n", lpMsg.message );
printf( "lpMsg.wParam <%d>\n", lpMsg.wParam );
printf( "lpMsg.lParam <%d>\n", lpMsg.lParam );
printf( "lpMsg.time <%d>\n", lpMsg.time );
printf( "lpMsg.pt.x <%d>\n", lpMsg.pt.x );
printf( "lpMsg.pt.y <%d>\n\n\n", lpMsg.pt.y );
}
}
system( "PAUSE" );
}