#include <GuiMenu.au3>
#include <WinAPI.au3>
#include <WinAPIConstants.au3>
#include <WindowsConstants.au3>
Local $hMenu, $hWnd = WinWait('WinHex') ; Some window
; ---
_MakePopup($hWnd)
; Спрятать меню окна
$hMenu = _GUICtrlMenu_GetMenu($hWnd)
If $hMenu Then _
_GUICtrlMenu_SetMenu($hWnd, 0)
; Восстановить
;_GUICtrlMenu_SetMenu($hWnd, $hMenu)
Func _MakePopup($hWnd)
Local $iOldStyle
; ---
$iOldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
If BitAnd($iOldStyle, $WS_CHILD) Then _
Return SetError(1, 0, False)
$iOldStyle = BitAnd($iOldStyle, BitNot($WS_CAPTION))
_WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitOr($iOldStyle, $WS_POPUP))
_WinAPI_SetWindowPos($hWnd, 0, 0, 0, 0, 0, BitOr($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOZORDER, $SWP_FRAMECHANGED))
; ---
Return True
EndFunc