測試窗口的後台模式非常簡單
從顏色 鼠標 鍵盤三個 依次進行測試即可. 比如顏色,我們可以如下測試,其中的gdi模式你可以換成別的顏色模式,看哪種模式可以正常的後台截圖,那麼這個模式就是你的後台模式 截的到圖我是放在了c:根目錄(根據dm.SetPath指定的目錄) set dm = createobject("dm.dmsoft") dm.SetPath "c:" hwnd = dm.GetMousePointWindow() dm_ret = dm.BindWindow(hwnd,"gdi","normal","normal",0) dm_ret = dm.Capture(0,0,2000,2000,"screen.bmp") dm_ret = dm.UnBindWindow() EndScript 比如鼠標,其中的windows你可以換成其它模式,測試鼠標要注意,坐標點(100,100)要換成窗口裡有意義的點,比如某個按鈕等. set dm = createobject("dm.dmsoft") hwnd = dm.GetMousePointWindow() dm_ret = dm.BindWindow(hwnd,"normal","windows","normal",0) dm.MoveTo 100,100 Delay 100 dm.LeftClick Delay 100 dm_ret = dm.UnBindWindow() EndScript 比如鍵盤,其中的windows你可以換成其它模式.注意下面的按下的虛擬鍵盤碼68要根據窗口換成有意義的按鍵. set dm = createobject("dm.dmsoft") hwnd = dm.GetMousePointWindow() dm_ret = dm.BindWindow(hwnd,"normal","normal","windows",0 dm.KeyPress 68 Delay 100 dm_ret = dm.UnBindWindow() EndScript
|