I am trying to record a ClipGet after Ctrl + C Is stroke.
Not working. It is possible ?
While (1) $msg = GUIGetMsg () Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch Local $hDLL = DllOpen("user32.dll") If _IsPressed ("A2",$hDLL) And _IsPressed ("56",$hDLL) Then Sleep (500) $ClipBoard = ClipGet () ;~ ==========================================Console============================================ _GUICtrlListView_AddItem($ConsoleArea,""&$ClipBoard) _GUICtrlListView_EnsureVisible($ConsoleArea, _GUICtrlListView_GetItemCount($ConsoleArea)-1) ;~ =========================================/Console============================================ EndIf DllClose ($hDLL) WEnd
Currently, I'm using Opencv UDF and i'm encountering issues with DLLOPEN(). it is failing and returning -1
But, I cannot figure out why it is failing.
I need help from people.
I'm running windows 10 32bit.
This's my code.
#RequireAdmin $fileopen = DllOpen("opencv_core2413.dll") MsgBox(0,"Result",$fileopen) Example.au3opencv_core2413.dll
I'm learning about GUI's, I'm trying the below code, the idea being if I press the letter "e" while I have the GUI open I want the label color to change to green (I'm using a UDF for label colors). But every time I press "e" on my keyboard I just get a "ding" sound from my speakers and nothing changes with the label.
I've looked at using something like "While GUIGetMsg() <> $GUI_EVENT_CLOSE" as I've seen it in other code instead of "While 1", but I don't think it's relevant.
#include <GUIConstantsEx.au3>; for GUI... #include <GUIRichLabel.au3>; UDF for rich text label fonts #include <Misc.au3>; for _IsPressed $myLetter = "e" $hGUI = GUICreate("test", 700, 60) $lbl2 = _GUICtrlRichLabel_Create($hGUI, '<font color="purple">' & $myLetter & '</font>', 10, 10); , 260, 25 GUISetState(@SW_SHOW) Local $hDLL = DllOpen("user32.dll") While 1 if _IsPressed(Hex($myLetter), $hDLL) Then While _IsPressed(Hex($myLetter), $hDLL) Sleep(250) WEnd _GUICtrlRichLabel_SetData($lbl2, '<font color="green">' & $myLetter & '</font>') Sleep(2000) DllClose($hDLL) Exit EndIf Sleep(50) WEnd DllClose($hDLL) I am using an array of letters that I'm wanting to do this for, but as I can't get it to work I've stripped it down to the simplest code I can think of to try and get this working first. Appreciate any help.
This script used to work on an older version of AutoIT. Currently I am running AutoIT v22.214.171.124 and it's failing.
Func PublicIP() ;Post public facing IP address Local $url = 'https://www.google.com/search?client=opera&q=what+is+my+ip&sourceid=opera&ie=UTF-8&oe=UTF-8' Local $getIPaddress = BinaryToString(InetRead($url)) Local $sStart = 'clamp:2">' Local $sEnd = '</div>' Local $ipaddress = _StringBetween($getIPaddress, $sStart, $sEnd For $i In $ipaddress MsgBox(0, 'External IP', "Your public IP address is " & $i) Next EndFunc ;==>PublicIP The console output shows:
"C:\Users\user\Documents\AutoIT\Scripts\WSI Tools.au3" (197) : ==> Variable must be of type "Object".: For $i In $ipaddress For $i In $ipaddress^ ERROR ->14:12:16 AutoIt3.exe ended.rc:1 +>14:12:16 AutoIt3Wrapper Finished. >Exit code: 1 Time: 9.811
I'm listing the error message strings, and roughly matching the error code
Is this how to do error reporting? Is there a more simple way I don't know about?
I realise I might not need to trap @error inside $error. I like it this way b/c I have no fear of overwriting @error now; I don't even use it.
Func Send_Connect($address, $port) $socket = TCPConnect($address, $port) $error = @error If $error <> 0 Then Local $aError = ["-2 not connected.", _ "1 IPAddr is incorrect.", _ "2 port is incorrect."] $aError = "10060 Connection timed out." If $error < 0 Then $error = 0 If $error > 2 Then $error = 3 MsgBox(0, "TCP Connect Error", $aError[$error], 0) $socket = 0 EndIf Return $socket EndFunc