メニューの所属するウィンドウを取得します。
#Include <GuiMenu.au3>
_GUICtrlMenu_FindParent($hMenu)
パラメータ
$hMenu | メニューハンドル |
返し値
成功: | ウィンドウハンドル |
失敗: | 0 |
注意
なし。
関連
_GUICtrlMenu_GetMenu
例
#include <GuiMenu.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hWnd, $hMain
Run("Notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
; メニューハンドルがメモ帳に属していることを表示
Writeln("Notepad handle: 0x" & Hex($hWnd))
Writeln("Menu Parent ..: 0x" & Hex(_GUICtrlMenu_FindParent($hMain)))
EndFunc ;==>_Main
; メモ帳にテキストを1行書き込む
Func Writeln($sText)
ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CR)
EndFunc ;==>Writeln