dear Experts.
I have a Automation Program ,Communicates with Word2010.
I want to Disable Close command on System Menu and Title bar.
I wrote this code by get Error on Line that Highlithed by Red:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Const MF_REMOVE = &H1000&
Const MF_BYPOSITION = &H400&
Dim Hwnd As Long
Dim MenuHWND As IntPtr
Hwnd = 0
Hwnd = FindWindow(Nothing, "Microsoft Word")
If Hwnd <> 0 Then
MessageBox.Show("Find Window")
MenuHWND = GetSystemMenu(Hwnd, 0)
If Not MenuHWND.Equals(IntPtr.Zero) Then
MessageBox.Show("Menu Can Handle")
RemoveMenu(MenuHWND, -1, MF_REMOVE Or MF_BYPOSITION)
End If
End If
any Solution available?