Need to Disable the Window Close Button (Upper right X) Confused on using API. The hwnd (A handle to a window) is giving a compile error... BC30451: "hwnd" as not declared. It may be inaccessible due to its protection level. hwnd relates to a Handle to a WiNDow. So how do I get the window handle that I want (need) to manipulate and pass that in as the hwnd value (that must be declared)? The following is the VB code and RemoveMenu at the end is where the compile error is... Private Declare Function GetSystemMenu Lib "user32" _ (ByVal hwnd As Integer, ByVal bRevert As Long) As _ Long Private Declare Function RemoveMenu Lib "user32" _ (ByVal hMenu As Integer, ByVal nPosition As Long, ByVal wFlags As Long) As Long Const MF_BYPOSITION = &H400 Const MF_APPEND = &H100& Private Sub Form_Load() RemoveMenu(GetSystemMenu(hwnd, 0), 2, MF_BYPOSITION) End Sub What is the window handle (hwnd) needed for GetSystemMenu? Thanks in advance.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)