New question #260970 on Sikuli:
https://answers.launchpad.net/sikuli/+question/260970

Hi everybody, 
I want to make a comment window which displaying short descriptions of the 
actions that sikuli automatically performing by script. For this reason I 
decided to use the windows DLL functions (User32.dll, DrawText) and I wrote the 
piece of code at the below.  The keyword POINTER at line 10 is not recognised 
by sikuli script. I got the error :  [error]: NameError( name 'pointer' is not 
defined) . Also keyword byref and addressof also not recoginised by sikuli. The 
other point that I could not understand is windll atribute when I used windll 
attribute I got the error that cyptes module has not got this attribute. By 
trying I found that cdll instead windll worked. Could you help me? How can I 
pass the pointer of variable into the dll function, and why I cannot use windll.

Thanks all for your interest

1)import ctypes
2)import array

3)User32=ctypes.cdll.User32
4)Gdi32=ctypes.cdll.Gdi32

5)User32.GetDC.argtypes=[ctypes.c_void_p]
6)dc=User32.GetDC(None)

7)rect=array()
8)rect=[0.0, 0.0, 200.0, 200.0]

9)User32.DrawTextA.argtypes=[ctypes.c_long,  ctypes.c_char_p,  ctypes.c_int,  
ctypes.c_void_p, ctypes.c_int]
10)User32.DrawTextA(dc, "Some Text For Sikuli Comment", -1, POINTER(rect), 0)


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to