I have the following API call. It seems to close only certain App's.
It closes Word documents, but if I try in on the Calculator.Exe, and other test EXE's, it does'nt close them. Is there something wrong here.
LPARAMETERS cAppTitle, lAllowSave
#DEFINE WM_DESTROY 0x0002
#DEFINE WM_CLOSE 0x0010
LOCAL nWinHandle
DECLARE INTEGER FindWindow IN Win32API;
STRING @lpClassName, STRING @lpWindowName
DECLARE INTEGER SendMessage IN Win32API;
INTEGER hwnd, INTEGER uMsg,;
INTEGER wParam, INTEGER lParam
* cAppTitle is the title bar text to search for
nWinHandle = FindWindow(0, @cAppTitle)
* nWinHandle will be greater than 0 if a match is found.
IF nWinHandle > 0
=SendMessage(nWinHandle, IIF(lAllowSave, WM_CLOSE,WM_DESTROY), 0, 0)
ENDIF
RETURN nWinHandle > 0
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people