Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to disable the close button
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00810350
Message ID:
00810632
Views:
87
Sasha, many thanks. Yes, it disables the close button, but user is still able to close it with Windows hot keys like Alt-f4 or alt-shift-f4. Do you know how to disable the particular hot key combination and for for particular window only?


>Hi Yuri,
>
>>If I know the window title or window handle, then how to disable the close button there? Could anybody provide a VFP-example of it?
>
>
>#define SC_CLOSE        0xF060
>#define MF_BYCOMMAND    0x00000000
>
>DECLARE Long GetSystemMenu IN WIN32API ;
>	Long hWnd, Long bRevert
>DECLARE Long RemoveMenu IN WIN32API ;
>	Long hMenu, Long uPosition, Long uFlags
>
>* disable close button
>hMenu = GetSystemMenu(_VFP.hWnd, 0)
>RemoveMenu(hMenu, SC_CLOSE, MF_BYCOMMAND)
>
>* enable close button
>hMenu = GetSystemMenu(_VFP.hWnd, 1)
>
Previous
Reply
Map
View

Click here to load this message in the networking platform