[파워빌더 API] Window 닫기버튼 비활성화
타이틀바 끝에 있는 X를 비활성화하는 방법입니다.
External Function
-----------------------------------------------------------------------------
Function Long GetSystemMenu (Long hwnd ,Long bRevert ) Library "user32"
Function Long GetMenuItemCount (Long hMenu ) Library "user32"
Function Long RemoveMenu (Long hMenu ,Long nPosition ,Long wFlags ) Library "user32"
Function Long DrawMenuBar (Long hwnd ) Library "user32"
-----------------------------------------------------------------------------
Script
-----------------------------------------------------------------------------
// H_WIN 은 해당윈도우의 핸들값
Long hSysMenu
Long nCnt
Constant Long MF_BYPOSITION = 1024
H_WIN = handle(윈도우명)
hSysMenu = GetSystemMenu(H_WIN, 0)
nCnt = GetMenuItemCount(hSysMenu)
RemoveMenu (hSysMenu, nCnt - 1, MF_BYPOSITION)
RemoveMenu (hSysMenu, nCnt - 2, MF_BYPOSITION)
DrawMenuBar(H_WIN)
-----------------------------------------------------------------------------
External Function
-----------------------------------------------------------------------------
Function Long GetSystemMenu (Long hwnd ,Long bRevert ) Library "user32"
Function Long GetMenuItemCount (Long hMenu ) Library "user32"
Function Long RemoveMenu (Long hMenu ,Long nPosition ,Long wFlags ) Library "user32"
Function Long DrawMenuBar (Long hwnd ) Library "user32"
-----------------------------------------------------------------------------
Script
-----------------------------------------------------------------------------
// H_WIN 은 해당윈도우의 핸들값
Long hSysMenu
Long nCnt
Constant Long MF_BYPOSITION = 1024
H_WIN = handle(윈도우명)
hSysMenu = GetSystemMenu(H_WIN, 0)
nCnt = GetMenuItemCount(hSysMenu)
RemoveMenu (hSysMenu, nCnt - 1, MF_BYPOSITION)
RemoveMenu (hSysMenu, nCnt - 2, MF_BYPOSITION)
DrawMenuBar(H_WIN)
-----------------------------------------------------------------------------