跳到主要内容

如何使用后台识别

下面是一个GDI后台识别的例子(只列举了OCR,其余函数类似)

hwnd = dm.GetForegroundWindow()
dm_ret = dm.GetClientSize(hwnd,screen_w,screen_h)
dm_ret = dm.SetDict(0,"C:\Documents and Settings\Administrator\桌面\1.txt")
dm_ret = dm.BindWindow(hwnd,"gdi","normal","normal",0)
s = dm.Ocr(0,0, screen_w, screen_h,"FEFB01-000000",1.0)
MessageBox s