Function Reference

_GUICtrlMenu_GetMenuBackground

メニューの背景に使用されるブラシを取得します。

#Include <GuiMenu.au3>
_GUICtrlMenu_GetMenuBackground($hMenu)

 

パラメータ

$hMenu メニューのハンドル

 

返し値

メニューの背景に使用されるブラシを返します。

 

注意

なし。

 

関連

_GUICtrlMenu_SetMenuBackground

 


#include <GuiMenu.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $hWnd, $hMain, $hFile, $hBrush

    ; メモ帳を開く
    Run("Notepad.exe")
    WinWaitActive("[CLASS:Notepad]")
    $hWnd = WinGetHandle("[CLASS:Notepad]")
    $hMain = _GUICtrlMenu_GetMenu($hWnd)
    $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)

    ; ファイルメニューの背景
    Writeln("File menu background: 0x" & Hex(_GUICtrlMenu_GetMenuBackground($hFile)))
    $hBrush = _WinAPI_GetSysColorBrush($COLOR_INFOBK)
    _GUICtrlMenu_SetMenuBackground($hFile, $hBrush)
    Writeln("File menu background: 0x" & Hex(_GUICtrlMenu_GetMenuBackground($hFile)))

EndFunc   ;==>_Main

; メモ帳にテキストを1行書き込む
Func Writeln($sText)
    ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CR)
EndFunc   ;==>Writeln