Disable Close Window With Alt+F4 In PowerBuilder
Alt-F4 is disabled if you remove the close option from the system menu for the window. To do this, use this code in the open event of the window where you want to disable Alt-F4
1 2 3 4 5 6 7 8 9 | //You will have to declare the Windows API calls as Local External Functions of the window: Function UInt GetSystemMenu( UInt hWnd, Boolean fRevert ) Library "USER" Function UInt DeleteMenu( UInt hMenu, UInt idItem, UInt fuFlags ) Library "USER" //[Call Event] UInt lUI_menuHandle lUI_menuHandle = GetSystemMenu( Handle( This ), False ) DeleteMenu( lUI_menuHandle, 61536, 0 ) |
Good Luck!