birdfw
birdfw
2021-03-04 15:48

AutoHotkey获取SysTreeView32树控件菜单句柄错误

AutoHotkey获取SysTreeView32树控件菜单句柄错误

DID1:=DllCall("User32\SendMessageW", Ptr, HWND, Ptr, 0x1110, Ptr,0x0000,Ptr,,Ptr)
SendMessage, 0x1110,TVGN_ROOT,,,ahk_id %HWND%
DID2:=ErrorLevel

两种方法都返回的是一样的个位数字,根本不是菜单句柄

而AutoIt3 获取就正常

Local $hfDID = DllCall("user32.dll", "handle", "SendMessageW", "hwnd", $hWnd, "uint", $TVM_GETNEXTITEM, "wparam", $TVGN_ROOT, "lparam", 0)

Local  $jd0=_GUICtrlTreeView_GetFirstItem($hWnd)

感觉是AHK的DllCall函数有问题,有解决方法吗

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答