layer Posted December 30, 2004 Posted December 30, 2004 hey guys... trying a dll call again... need a little help :"> im using CreatePen and what i have looks like this...$pen= DllCall ("Gdi32.dll", "hwnd", "CreatePen", "int", "PS_SOLID") Func _IsPressed($hexKey) ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. ; $hexKey should entered as a string, don't forget the quotes! ; (yeah, layer. This is for you) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc ;==>_IsPressed While 1 If _IsPressed('01') = 1 then $pen= DllCall ("Gdi32.dll", "hwnd", "CreatePen", "hwnd", "PS_SOLID") endif wendis there a gui i must create to allow such drawing? or is there something im doing wrong...BTW: Ezzetabi i never realized the ; (yeah, layer. This is for you) lol thanks FootbaG
layer Posted December 30, 2004 Author Posted December 30, 2004 here... i updated it, but now i think i will need to do selectobject right? $pen= DllCall ("Gdi32.dll", "hwnd", "CreatePen", "int", "PS_SOLID") Func _IsPressed($hexKey) ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. ; $hexKey should entered as a string, don't forget the quotes! ; (yeah, layer. This is for you) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc ;==>_IsPressed While 1 If _IsPressed('01') = 1 then $pen= DllCall ("Gdi32.dll", "ptr", "CreatePen", "ptr", "PS_SOLID", "ptr", 2, "ptr", 0xff0000) endif wend tell me if im right or wrong :/ is there a certain gui style that allows this kicd of input? FootbaG
ezzetabi Posted December 30, 2004 Posted December 30, 2004 (edited) This sound strange... [...] "int", "PS_SOLID") You pass a string as an Int? If it is a constant probably Autoit does not know it. Checked... The value of PS_Solid is 0, so it may work. But it better using [...] "int", 0) or $PS_SOLID = 0 [...] "int", $PS_SOLID) Edit: Oh yes... I added ; (yeah, layer. This is for you) because you had problem sending the value as a int... Edited December 30, 2004 by ezzetabi
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now