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:
00810467
Views:
41
This message has been marked as the solution to the initial question of the thread.
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
Next
Reply
Map
View

Click here to load this message in the networking platform