[Common]
Description=演示获取指定窗口的子窗口句柄的方法
HotKeyStart=119
HotKeyStop=121
HotKeyPause=0
Enabled=0
RunOnce=1

[Data]


[Script]
//下面代码演示如何调用API来查找记事本中的编辑窗口的句柄
//需要有一个查看窗口类的工具来帮助找到子窗口的类名，这里是"Edit"
var hLib=0
var hWnd=0
main:
  var hMain=0
  set hMain=GetWindowByTitle("无标题 - 记事本")
  do DebugMsg("$"+IntToHex(hMain,8))
  set hLib=APIOpen("User32.dll","FindWindowExA","IISI:I","S")
  set hWnd=APICall(hLib,hMain,0,"Edit",0)
  do DebugMsg("$"+IntToHex(hWnd,8))
  do SendStr(hWnd,"很好很强大")
endmain

finally
  do APIClose(hLib)
end
