>>I placed a code in the deactivate method of a form
>>
>>if thisform.windowstate=1
>> =minimize to tray
>>endif
>>
>>this works when you run the form but when i compile it to an exe it doesn't. Any workaround?
>>
>>Thanks
>
>Try _screen.windowstate instead of thisform.windowstate - might work.
Failing that, the following API code might work:
DECLARE INTEGER GetActiveWindow IN WIN32API
DECLARE INTEGER IsIconic IN WIN32API INTEGER hWnd
lIsMinimized = IsIconic(GetActiveWindow()) # 0