Exit an Application
-
Here I have a problem I am trying to automate Applications (FILE->EXIT) function. that is closing the application. Problem : When I open my application using createProcess() a notification is sent tat application started.But when i used following to close application no nofication is sent. if( TerminateProcess(piProcessInfo.hProcess,0)) { CloseHandle(piProcessInfo.hProcess); } This code is not acting as way as (FILE->EXIT) Please help!!! :~
-
Here I have a problem I am trying to automate Applications (FILE->EXIT) function. that is closing the application. Problem : When I open my application using createProcess() a notification is sent tat application started.But when i used following to close application no nofication is sent. if( TerminateProcess(piProcessInfo.hProcess,0)) { CloseHandle(piProcessInfo.hProcess); } This code is not acting as way as (FILE->EXIT) Please help!!! :~
-
Here I have a problem I am trying to automate Applications (FILE->EXIT) function. that is closing the application. Problem : When I open my application using createProcess() a notification is sent tat application started.But when i used following to close application no nofication is sent. if( TerminateProcess(piProcessInfo.hProcess,0)) { CloseHandle(piProcessInfo.hProcess); } This code is not acting as way as (FILE->EXIT) Please help!!! :~
TerminateProcess is not good idea for close a program you can send WM_CLOSE to your program.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
TerminateProcess is not good idea for close a program you can send WM_CLOSE to your program.
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
If your target applciation has a window, you can find your target application using FindWidnow() API. This will return the window handle of the target application. Using that handle you can send WM_CLOSE message. Ex: HWND hWnd = ::FindWindow( NULL, "TargetAppName" ); ::SendMessage( hWnd, WM_CLOSE );
akt
-
If your target applciation has a window, you can find your target application using FindWidnow() API. This will return the window handle of the target application. Using that handle you can send WM_CLOSE message. Ex: HWND hWnd = ::FindWindow( NULL, "TargetAppName" ); ::SendMessage( hWnd, WM_CLOSE );
akt