I have question. I tried to send a signal to notepad for close ITS process by using code below
if pos('NOTEPAD',UpperCase(sName)) > 0 then
postMessage(FindWindow(ClassName, TheText), WM_CLOSE, 0, 0);
end
But if notepad is not blank it would need confirmation to close and it would not if notepad empty
so I wanna make if condition for it after WM_CLOSE
signal has sended
I tried this code
if pos('NOTEPAD',UpperCase(sName)) > 0 then
begin
postMessage(FindWindow(ClassName, TheText), WM_CLOSE, 0, 0);
Show message('signal to close has sended')
if not postMessage(FindWindow(ClassName, TheText), WM_CLOSE, 0, 0) then
Begin
Show message(' signal sended but process still exist it might need confirmation to close')
End;
End;
But code above was not working. Is there anyway to make the result of if condition after WM_CLOSE
signal sended?
Thanks