Leaderboard
Popular Content
Showing content with the highest reputation on 05/24/2020 in all areas
-
Sorry to hear you have lost 8 fingers...4 points
-
Added to the current Beta version.... tnx4 points
-
How to detect if au3 was launched from Visual Studio Code?
Danyfirex and one other reacted to argumentum for a topic
#include <Debug.au3> #include <WinAPIProc.au3> _DebugArrayDisplay(WhereAreMyParents(), "WhereAreMyParents") Func WhereAreMyParents($iPID = @AutoItPID) Local $s, $a[11][3] = [[0, "", ""]] $a[1][0] = $iPID $a[1][1] = _WinAPI_GetProcessName($iPID) $a[1][2] = _WinAPI_GetProcessCommandLine($iPID) For $n = 2 To 10 $iPID = _WinAPI_GetParentProcess($iPID) If $iPID = 0 Then ExitLoop $a[0][0] = $n $a[$n][0] = $iPID $a[$n][1] = _WinAPI_GetProcessName($iPID) $a[$n][2] = _WinAPI_GetProcessCommandLine($iPID) Next ReDim $a[$a[0][0] + 1][3] Return $a EndFunc ;==>WhereAreMyParents ..I know I'm late but I type with 2 fingers and I was quite invested so, there !2 points -
I think you would need to use 2 get parent process. With Scite at least it is working... MsgBox ($MB_SYSTEMMODAL,"",_WinAPI_GetProcessName(_WinAPI_GetParentProcess(_WinAPI_GetParentProcess())))1 point
-
I want to copy and paste specific text only
charlie2charlie reacted to Jos for a topic
You're welcome.... check back here when you have had a play with it and get stuck.1 point -
login in my ebay problem
argumentum reacted to faustf for a topic
@argumentum take a start at "UDF" aslo if i dont like do UDF with macro , i think is not much stable , i think if exist API will be better #include <IE.au3> $url = "https://signin.ebay.it/ws/eBayISAPI.dll?SignIn&UsingSSL=1&pUserId=&co_partnerId=2&siteid=101&ru=https%3A%2F%2Fmy.ebay.it%2Fws%2FeBayISAPI.dll%3FMyEbayBeta%26MyEbay%3D%26gbh%3D1%26guest%3D1&pageType=3984" $User = "XXXXXX" $Pass = "xxxxxx" _eBayLogin($url,$User,$Pass) Func _eBayLogin($sUrl,$sUser,$sPass) $oIE = _IECreate($sUrl, 0, 1, 1, 1) ; <--- 0011 invisible explorer <--- 0111 visible explorer $oDoc = _IEDocGetObj($oIE) $oEvt = $oDoc.createEvent("HTMLEvents") $oEvt.initEvent("input", True, False) Sleep(5000) $oUsername = _IEGetObjById($oIE,"userid") _IEFormElementSetValue($oUsername, $sUser) $oUsername.dispatchEvent($oEvt) Sleep(1000) $oButton = _IEGetObjById($oIE,"signin-continue-btn") _IEAction($oButton, "click") Sleep(5000) $oPassword = _IEGetObjById($oIE,"pass") _IEFormElementSetValue($oPassword, $sPass) $oPassword.dispatchEvent($oEvt) Sleep(1000) $oButton = _IEGetObjById($oIE,"sgnBt") _IEAction($oButton, "click") EndFunc1 point -
You need to trigger the element's "input" event. See code at below link for an example --1 point
-
I got the x64 portion of this working now.1 point
-
ObjEvent - Bytescout.PDFExtractor.dll + ProgressEventHandler
mLipok reacted to argumentum for a topic
since you know how to use CLR, and given that the code they provide run as expected, then run the VB.NET or C#, plus an IPC to AutoIt. My idea is based in that: 1) is possible and 2) you know how. Because I don't believe that it would work with VBScript, as they show every possible example in the help file and the only ones that show an example of "_ProgressChanged" is in those. Then again, all this is well above my know how. Maybe there is a way to do it all from script. I'll be following this thread to see how it got solved.1 point -
ObjEvent - Bytescout.PDFExtractor.dll + ProgressEventHandler
argumentum reacted to mLipok for a topic
Check this: TestBytescoutThing() Func TestBytescoutThing() Local $oErrorHandler = ObjEvent("AutoIt.Error", _ErrFunc) #forceref $oErrorHandler Local $oBytescoutThing = ObjCreate("Bytescout.PDFExtractor.SearchablePDFMaker") $oBytescoutThing.RegistrationName = "demo" $oBytescoutThing.RegistrationKey = "demo" $oBytescoutThing.LoadDocumentFromFile(@MyDocumentsDir & "\ByteScout Samples\PDF Extractor SDK\sample_ocr.pdf") ;// Extractor Progress event Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "_ProgressChanged") ; This will fire COM ERROR ; TYPE_E_FIELDNOTFOUND 0x80028017 Field name not defined in the record. #forceref $oBytescoutThing_Event ; Set the location of OCR language data files $oBytescoutThing.OCRLanguageDataFolder = "c:\Program Files\Bytescout PDF Extractor SDK\ocrdata_best\" ; Set OCR language $oBytescoutThing.OCRLanguage = "eng" ; Set PDF document rendering resolution $oBytescoutThing.OCRResolution = 300 ; Save extracted text to file $oBytescoutThing.MakePDFSearchable(@ScriptDir & "\BytescoutThingoutput.pdf") ConsoleWrite("! " & @ScriptLineNumber & @CRLF) ShellExecute(@ScriptDir & "\BytescoutThingoutput.pdf") EndFunc ;==>TestBytescoutThing Func _PDFExtractor_ProgressChanged($sender_As_Object, $ongoingOperation_As_OngoingOperation, $progress_As_Double, $cancel_As_Boolean = False) ConsoleWrite('- Func _PDFExtractor_ProgressChanged("' & $sender_As_Object & '", "' & $ongoingOperation_As_OngoingOperation & '", "' & $progress_As_Double & '", "' & $cancel_As_Boolean = False & '")' & @CRLF) EndFunc ;==>_PDFExtractor_ProgressChanged ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc You will notice 2 things: 1. With community edtion of this component AutoIt is never reach this above lines: ConsoleWrite("! " & @ScriptLineNumber & @CRLF) ShellExecute(@ScriptDir & "\BytescoutThingoutput.pdf") 2. As my example have COM Error handler you will see that : Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "_ProgressChanged") fires ERROR: btw. I also tried one this way: ;~ Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor") ; TYPE_E_FIELDNOTFOUND 0x80028017 Field name not defined in the record. ;~ Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "ProgressEvent") ; TYPE_E_FIELDNOTFOUND 0x80028017 Field name not defined in the record. ;~ Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "ProgressEventHandler") ; TYPE_E_TYPEMISMATCH 0x80028CA0 Type mismatch. ;~ Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "_ProgressEventHandler") ; EVENT_S_SOME_SUBSCRIBERS_FAILED 0x80040200 An event was able to invoke some but not all of the subscribers ;~ Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "_ProgressEventHandler_2") ; EVENT_S_SOME_SUBSCRIBERS_FAILED 0x80040200 An event was able to invoke some but not all of the subscribers ;~ Local $oBytescoutThing_Event = ObjEvent($oBytescoutThing, "_PDFExtractor", "_ProgressEventHandler_3") ; EVENT_S_SOME_SUBSCRIBERS_FAILED 0x80040200 An event was able to invoke some but not all of the subscribers With no success . For this reason I looked into tlb but was not found solution.1 point -
I haven't installed terraform yet to try, but the following regexp pattern by @jchd removes the escape sequences from the whole text. You can use it to clean the whole StdOut before processing it: Local $sStdOut ; set here a text with escape sequences embedded ; remove escape sequences (by @jchd) Local $sClean = StringRegExpReplace($sStdOut, "(?x) (\x1B \[ (?:\s*\d*\s*;?)* [[:alpha:]])", "") MsgBox(0, "Pure text", $sClean) see here for reference:1 point
-
login in my ebay problem
TheDcoder reacted to argumentum for a topic
lol, now that is a funny sight 😜1 point -
Hello. You can do something like this. Opt("MustDeclareVars", 1) Global Enum $eRender, $eCapture, $eAll, $EDataFlow_enum_count ;~ AudioSessionState Global Const $CLSCTX_INPROC_SERVER = 0x01 Global Const $eMultimedia = 1 Global Const $sCLSID_MMDeviceEnumerator = "{BCDE0395-E52F-467C-8E3D-C4579291692E}" Global Const $sIID_IMMDeviceEnumerator = "{A95664D2-9614-4F35-A746-DE8DB63617E6}" Global Const $sTagIMMDeviceEnumerator = _ "EnumAudioEndpoints hresult(int;dword;ptr*);" & _ "GetDefaultAudioEndpoint hresult(int;int;ptr*);" & _ "GetDevice hresult(wstr;ptr*);" & _ "RegisterEndpointNotificationCallback hresult(ptr);" & _ "UnregisterEndpointNotificationCallback hresult(ptr)" Global Const $sIID_IMMDevice = "{D666063F-1587-4E43-81F1-B948E807363F}" Global Const $sTagIMMDevice = _ "Activate hresult(struct*;dword;ptr;ptr*);" & _ "OpenPropertyStore hresult(dword;ptr*);" & _ "GetId hresult(wstr*);" & _ "GetState hresult(dword*)" Global Const $sIID_IAudioSessionEnumerator = "{e2f5bb11-0570-40ca-acdd-3aa01277dee8}" Global Const $sTagIAudioSessionEnumerator = "GetCount hresult(int*);GetSession hresult(int;ptr*)" Global Const $sIID_IAudioEndpointVolume = "{5CDF2C82-841E-4546-9722-0CF74078229A}" Global Const $sTagIAudioEndpointVolume = _ "RegisterControlChangeNotify hresult(ptr);" & _ "UnregisterControlChangeNotify hresult(ptr);" & _ "GetChannelCount hresult(uint*);" & _ "SetMasterVolumeLevel hresult(float;ptr);" & _ "SetMasterVolumeLevelScalar hresult(float;ptr);" & _ "GetMasterVolumeLevel hresult(float*);" & _ "GetMasterVolumeLevelScalar hresult(float*);" & _ "SetChannelVolumeLevel hresult(uint;float;ptr);" & _ "SetChannelVolumeLevelScalar hresult(uint;float;ptr);" & _ "GetChannelVolumeLevel hresult(uint;float*);" & _ "GetChannelVolumeLevelScalar hresult(uint;float*);" & _ "SetMute hresult(int;ptr);" & _ "GetMute hresult(int*);" & _ "GetVolumeStepInfo hresult(uint*;uint*);" & _ "VolumeStepUp hresult(ptr);" & _ "VolumeStepDown hresult(ptr);" & _ "QueryHardwareSupport hresult(dword*);" & _ "GetVolumeRange hresult(float*;float*;float*)" Local $pIMMDevice = 0 Local $oMMDevice = 0 Local $oMMDeviceEnumerator = ObjCreateInterface($sCLSID_MMDeviceEnumerator, $sIID_IMMDeviceEnumerator, $sTagIMMDeviceEnumerator) If Not IsObj($oMMDeviceEnumerator) Then Exit If FAILED($oMMDeviceEnumerator.GetDefaultAudioEndpoint($eCapture, $eMultimedia, $pIMMDevice)) Then Exit ConsoleWrite("$pIMMDevice: " & $pIMMDevice & @CRLF) $oMMDevice = ObjCreateInterface($pIMMDevice, $sIID_IMMDevice, $sTagIMMDevice) If Not IsObj($oMMDevice) Then Exit ConsoleWrite("IsObj($oMMDevice): " & IsObj($oMMDevice) & @CRLF) Local $pIAudioEndpointVolume = 0 Local $oIAudioEndpointVolume = 0 If FAILED($oMMDevice.Activate(__uuidof($sIID_IAudioEndpointVolume), $CLSCTX_INPROC_SERVER, 0, $pIAudioEndpointVolume)) Then Exit ConsoleWrite("$pIAudioEndpointVolume: " & $pIAudioEndpointVolume & @CRLF) $oIAudioEndpointVolume = ObjCreateInterface($pIAudioEndpointVolume, $sIID_IAudioEndpointVolume, $sTagIAudioEndpointVolume) ConsoleWrite("IsObj($oIAudioEndpointVolume): " & IsObj($oIAudioEndpointVolume) & @CRLF) Local $bMute = 0 $oIAudioEndpointVolume.GetMute($bMute) ConsoleWrite("Mute: " & $bMute & @CRLF) Sleep(3000) $bMute = $bMute ? 0 : 1 ;Set Mute Exchange State ConsoleWrite("Set Mute To: " & $bMute & @CRLF) $oIAudioEndpointVolume.SetMute($bMute, 0) Exit Func FAILED($hr) Return ($hr < 0) EndFunc ;==>FAILED Func __uuidof($sGUID) Local $tGUID = DllStructCreate("ulong Data1;ushort Data2;ushort Data3;byte Data4[8]") DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sGUID, "struct*", $tGUID) If @error Then Return SetError(@error, @extended, 0) Return $tGUID EndFunc ;==>__uuidof Saludos1 point
-
1 point
-
I do not like Charmap, it's too small and you can't test a character with another font, you only get all chars for each font so it's not very handy. SpecialCharactersViewer permit with the Segoe UI Symbol font to display a maximum ( not all! ) of Ascii and Unicode characters. Simple click on a char and the corresponding Chr or ChrW code is displayed. Free to you to choose another font for see if the selected character can be used with. Windows XP do not have Segoe UI Symbol font, so it's more for Win7/Win8 users... Previous downloads : 100 Source : SpecialCharactersViewer v1.0.1.0.au3 Executable : SpecialCharactersViewer.exe.html (Once this html file downloaded, double click on it for start the download) Will be added to the next version of SciTE Hopper. Hope it can help !1 point
-
GUIGetMSG and sleep
BlackLumiere reacted to Ejoc for a topic
Ok I finally figured it out and have a true solution w/ a reason: GUIGetMSG() does pull Events Queued up by windows, so you dont have to catch events in real time. The GUI is getting flodded w/ $GUI_EVENT_MOUSEMOVE's. So when you put in a sleep() the Queue for your window is filled with Mouse moves, and it will sleep() for each of those mouse moves before getting to the $GUI_EVENT_CLOSE. so w/ the code: #include <GUIConstants.au3> GUICreate("test") GuiSetState() While 1 $msg = GUIGetMSG() if $msg = $GUI_EVENT_CLOSE Then Exit sleep(1000) Wend We sleep for 1 second. We click close during the sleep() Our Queue is now $GUI_EVENT_MOUSEMOVE, $GUI_EVENT_MOUSEMOVE, $GUI_EVENT_MOUSEMOVE, $GUI_EVENT_CLOSE We have to sleep for 1 second for each $GUI_EVENT_MOUSEMOVE before closing so in this case 3 seconds before closing Now w/ the new code: #include <GUIConstants.au3> GUICreate("test") GuiSetState() While 1 $msg = GUIGetMSG() if $msg = $GUI_EVENT_CLOSE Then Exit if $msg = 0 Then sleep(1000) Wend We sleep for 1 second. Click close during the sleep() Our Queue is now $GUI_EVENT_MOUSEMOVE, $GUI_EVENT_MOUSEMOVE, $GUI_EVENT_MOUSEMOVE, $GUI_EVENT_CLOSE Now we dont do anything if it was a $GUI_EVENT_MOUSEMOVE And process the $GUI_EVENT_CLOSE nearly immediately after we are done sleeping1 point