8 posts in this topic
I've written the code below which launches chrome in incognito mode and then proceeds to go to the autoit website.
From my understanding, the Run() command is also supposed to output the PID number related to the application that got launched from the Run command.
However when I run the below lines, it outputs a PID number that is different from the newly launched chrome browser's PID number, does anyone know why and possibly explain how I could retrieve the accurate PID number associated with the newly launched browser?
Global $iPid = Run(@ComSpec & ' /c start chrome.exe https://www.autoitscript.com/forum/ -incognito' ,"", "") msgbox(0,"",$iPid) Thank you,
I have read the Tutorial. Used the Help File and used an example script by @Melba23. I am still struggling.
To use GUIRegisterMsg one needs the following
a control in the GUI a GUIRegisterMsg instruction in the GUI to link the control to the WM_COMMAND function a Case statement in the Switch loop to run it a WM_COMMAND function and a processor function... Mine looks like this
;~ ; QuickSearch combo box $g_cbQwkSrch = GUICtrlCreateCombo("", 8, 26, 180, 17) ; start blank GUICtrlSetTip($g_cbQwkSrch, "Type to search", "QuickSearch") GUIRegisterMsg($WM_COMMAND, "__WM_COMMAND_QWKSEARCH_CMB") ;------------------------------------ ; use in Switch Loop ;~ ; QuickSearch Case $g_cbQwkSrch ConsoleWrite("221 Case $g_cbQwkSrch" & @CRLF) ;-------------------------------------- Func _QwkSrch_Edit_Changed() ConsoleWrite("41 _QwkSrch_Edit_Changed" & @CRLF) ; Autocomplete the edit _GUICtrlComboBox_AutoComplete($g_cbQwkSrch) ; Change the label to match the autocompleted edit entry EndFunc ;==>_QwkSrch_Edit_Changed Func __WM_COMMAND_QWKSEARCH_CMB($hWnd, $iMsg, $wParam, $lParam) ; GUIRegisterMsg($WM_COMMAND, "__WM_COMMAND_QWKSEARCH_CMB") ConsoleWrite("50 _WM_COMMAND_QWKSEARCH_CMB fired " & @CRLF) Local $Found = '' #forceref $hWnd, $iMsg If $lParam = GUICtrlGetHandle($g_cbQwkSrch) And BitShift($wParam, 16) = $CBN_EDITCHANGE Then ; Our combo edit content has changed ; get data from source ---------------------------- Local $datafromsource = fFindFilesForQuickSearch($stringtofind) ; datafromsource convert to Combo friendly format ; Add data to combo _GUICtrlComboBox_BeginUpdate($g_cbQwkSrch) GUICtrlSetData($g_cbQwkSrch, $Found) _GUICtrlComboBox_EndUpdate($g_cbQwkSrch) EndIf _QwkSrch_Edit_Changed() ; Action this function EndIf EndFunc ;==>_WM_COMMAND_QWKSEARCH_CMB Func fFindFilesForQuickSearch($stringtofind) ; helper function for QuickSearch ; get data here Return $aResult EndFunc ;==>fFindFilesForQuickSearch Now the following:
Can I declare the variable $g_cbQwkSrch in Global, then use in multiple functions - reassigning different combo's to it as I go along? Should GUIRegisterMsg be expressly de-registered, or does that happen automatically at GuiDelete()? Where is the best/correct place to call GUIRegisterMsg? With the creation of its control, before the GUISetState, or before the start of the loop? The Help File contains this entry, what is the intent? Must this always be called with four args, or a max of four... !!! To make the user function workable you have to define it with maximum 4 function parameters otherwise the function won't be called !!!
I wonder if
AutoIt3Wrapper_run_debug_mode = Y can include run information about functions which are called within the main code. So far I noticed in the console that the function itself is called but no specific run information from inside the function is provided. Is there a chance to show the entire debug log including functions in the console?
I furthermore noticed a stop of information when a loop is entered. What could be the reason for that?
Thanks for help.
I need help to understand why the run function does not work, but if i use it directly inside cmd shell the command works. $where is the name of the jpg file
ShellExecute(@ComSpec ," /k C:\Users\root\Desktop\test\exiftool.exe -p $FileName "&'"'&$where&'"'&" > "&'"'&@ScriptDir&"\out.txt"&'"',@ScriptDir);<----- work Run("C:\Users\root\Desktop\test\exiftool.exe -p $FileName "&$where&" > "&@ScriptDir&"\out.txt",@ScriptDir);<--- doesn't work I would use the run command!
Best example I could find is here
The way I understand this, the standard Windows messages, such as Left/Right Click etc are covered by AutoIt macros, but the real power is locked up inside this WM_NOTIFY . I have tried, but I am not even sure I understand what I am looking at.
I need help understanding this. What I am looking for is Help file or Tutorial explaining how this works?
Perhaps if there is a script showing both the working of an AutoIt macro and the WM_NOTIFY in action, it would help.
Right now I am so lost, I do not even know what are the right questions to ask. One issue I have is on ListViews, how to combine the "Click" of a line with a standard Switch loop? Like users clicks a line, then get the loop to detect the click and ;do something ...