>>>
>>>Yes, I did it - but it seems like it behaves the same as close in the right corner of the screen, as my question - do you want to close application, is now asked.
>>>
>>>In other words, what exactly does this code simulate?
>>
>>It sends a WM_CLOSE as if you wanted to close the app with the closebox
>>
>>Why all the hassle ? Bypass your question for the tests - or better - click via taskbar - no code needed
>>
>>>
>>>#define PROCESS_ALL_ACCESS (0x000F0000 + 0x00100000 + 0x0FFF)
>>>
>>>#define WM_CLOSE 0x0010
>>>
>>>DECLARE INTEGER FindWindow ;
>>>IN WIN32API STRING cNull, STRING cWinName
>>>
>>> declare integer PostMessage in user32.dll long, long, long, long
>>>
>>>
>>>LOCAL lnHwnd
>>>lnHwnd = FindWindow(0,'SysManager 9.0.00')
>>>
>>>=PostMessage(lnHWnd, WM_CLOSE, 0, 0)
>>>
>
>The question is:
>can I determine if I (the user) clicked on this x or it was send from the outside?
Simple : try with
#define WM_QUIT 0x0012
Gregory