-
Posts
5,125 -
Joined
-
Last visited
-
Days Won
10
Community Answers
-
FireFox's post in Varriable's return every time 1 .. why? was marked as the answer
Please read the helpfile, it's not how the function (FileFindFirstFile) should be used.
-
FireFox's post in if $array[0][$i] = "" then exitloop (does not work) was marked as the answer
Hi,
Not sure if your situation is included in this page of the doc, but to be short, 0 equals an empty string.
You need to either use IsNumber/IsString or compare with VarGetType.
Br, FireFox.
-
FireFox's post in need help with idle timer was marked as the answer
Hi,
Welcome to the autoit forum
#include <Timers.au3> #include <Misc.au3> Global $iPid = 0 While 1 ;loop to constantly check conditions If ($iPid = 0 Or ProcessExists($iPid) = 0) And _Timer_GetIdleTime() > 5000 Then ;if notepad isn't opened ;and the user is idle for more than 5secs $iPid = Run("notepad") EndIf If $iPid > 0 And _Timer_GetIdleTime() < 500 Then ;if notepad is opened ;and the user isn't idle ProcessClose($iPid) $iPid = 0 EndIf WEnd Note : _Singleton can not be used here to avoid reopening a process, it can only be used for your own script unless you know the target process is using the function with the "occurrence identifier".
Br, FireFox.
-
FireFox's post in help with DllStructCreate/DllStructGetData was marked as the answer
huh, then what's wrong with the function available in the forum? It does exactly what you're looking for...
-
FireFox's post in Array memory allocation was marked as the answer
Why don't you use the UBound function?
-
FireFox's post in Hotkeyset a simple function - script not running for than a few ms was marked as the answer
Hi,
Welcome to the autoit forum
How do you expect something to run indefinitly if it has nothing to do?
You need to add an endless loop :
... While 1 Sleep(10) WEnd ... Please read the helpfile, if you did you would have seen that.
Br, FireFox.
-
FireFox's post in Setting text in Edit2 box also sets it in Edit3 box was marked as the answer
The thing is : it's the same in manual mode.
-
FireFox's post in connect to serverpath with password was marked as the answer
Hi,
Maybe your looking for the DriveMapAdd function?
Br, FireFox.
-
FireFox's post in ini value linked to send was marked as the answer
Take a look at the helpfile for IniRead, IniWrite.
Br, FireFox.
-
FireFox's post in How to reset, Until = 0 justs keeps going on an on was marked as the answer
Hi,
Welcome to the autoit forum
If you follow what the scripts does, you will see your counter is never reset.
;1 Global $start = TimerInit() Local $restart = 15 Global $state = "Init"; ;2 Init(); While 1 ;4 Start() ;8 ;$restart = 0 ;and then step 9 is step 4 because it's a loop ;so the $restart will be decremented from 0 and not from 15 WEnd Func Init() ;3 EndFunc ;==>Init Func Start() ;5 ;$restart = 15 Do ;6 ;$restart = 15 ... 0 Sleep(1000) ToolTip("Restarting in: " & $restart & "", 1, 1) $restart = $restart - 1 Until $restart = 0 Sleep(2000) ;7 ;$restart = 0 EndFunc ;==>Start I let you fix it by yourself.
Br, FireFox.
-
FireFox's post in Exact match from array was marked as the answer
Why don't you stick to your previous thread?
Local $answer = StringRegExp(FileRead($os), '(?m)^.*Windows\s[^\d].*$', 3) -
FireFox's post in How to set handle of icon as an img of a button control was marked as the answer
Hi,
This is working fine for me :
$sSFile = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" GUICtrlCreateButton("", 10, 10, 80, 80, $BS_BITMAP) _GUICtrlButton_SetImage(GUICtrlGetHandle(-1), $sSFile, 0, True) Br, FireFox.
-
FireFox's post in Return whole line in array was marked as the answer
Local $answer = StringRegExp(FileRead($os), '(?m)^.*Windows 7.*$', 3) -
FireFox's post in Script exits immediately in SciTE was marked as the answer
The #RequireAdmin function forces the script to run as administrator.
Since your SciTE is not run as admin it can't execute your script with admin privileges, so it won't be the owner of your process.
Br, FireFox.
-
FireFox's post in How to change "x" letters in a text? was marked as the answer
Hi,
StringReplace.
Br, FireFox.
-
FireFox's post in Is there any compile optimizations planned? was marked as the answer
Use these directives :
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/striponly #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** -
FireFox's post in ProgressBar set TopMost was marked as the answer
Hi,
Edit the GUI styles like this :
GUICreate("Marquee Progress RTL", 500, 50, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Br, FireFox.
-
FireFox's post in _IEQuit($oIE) - Do you want to kill user session forcefully? was marked as the answer
Hi,
Welcome to the autoit forum
This popup comes from the webpage itself and not internet explorer.
If you can send some javascript to the page (using IE functions), unbind the "beforeunload" event to avoid the popup.
Br, FireFox.
-
FireFox's post in Getting error on running _WinAPI_GetProcessMemoryInfo was marked as the answer
Hi,
As you pointed out, you need permissions to get those memory infos of processes created by other users even if you are admin.
For this you will need to adjust the privileges of your process in order to be granted for this request.
I just made an example for you :
#RequireAdmin #include <ProcessConstants.au3> #include <SecurityConstants.au3> #include <Security.au3> #include <WinAPI.au3> #include <WinAPIProc.au3> #include <Array.au3> Example() Func Example() ; Open the current process in ALL ACCESS mode, with no inheritance for child processes. Local $hProcess = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, False, @AutoItPID) ; If the function failed, return False. If $hProcess = 0 Then Return False ; Open the access token associated with the current process (an access token contains ; the security information for a logon session. ; What matter to us is the privileges contained by this token. Local $hToken = _Security__OpenProcessToken($hProcess, $TOKEN_ALL_ACCESS) ; If the function failed, return False. If $hToken = 0 Then Return False ; Close the current process handle. _WinAPI_CloseHandle($hProcess) ; Retrieves the LUID (locally unique identifier) which represents the SE_DEBUG privilege. Local $iLUID = _Security__LookupPrivilegeValue("", $SE_DEBUG_NAME) ; If the function failed, return False. If $iLUID = 0 Then Return False ; Create a struct containing the TOKEN_PRIVILEGES tag. Local $tTOKENPRIV = DllStructCreate($tagTOKEN_PRIVILEGES) ; Fill the struct with the right infos. DllStructSetData($tTOKENPRIV, "Count", 1) DllStructSetData($tTOKENPRIV, "LUID", $iLUID, 1) DllStructSetData($tTOKENPRIV, "Attributes", $SE_PRIVILEGE_ENABLED, 1) ; Now adjust the token privilege to enable the DEBUG privilege. Local $fAdjust = _Security__AdjustTokenPrivileges($hToken, False, DllStructGetPtr($tTOKENPRIV), DllStructGetSize($tTOKENPRIV)) ; If the function failed, return False. If Not $fAdjust Then Return False ; Release the resources used by the structure. $tTOKENPRIV = 0 ; Do whatever with privileges here. Local $aPmi = _WinAPI_GetProcessMemoryInfo(ProcessExists("winlogon.exe")) _ArrayDisplay($aPmi) ; Close the token handle. _WinAPI_CloseHandle($hToken) EndFunc ;==>Example Br, FireFox.
-
FireFox's post in 0xFF0000 is blue? was marked as the answer
#include <WinAPIGdi.au3> _WinAPI_SwitchColor(0xFF0000) -
FireFox's post in put variable in _FFCmd("FFau3.xpath.value=' ' ") was marked as the answer
_FFCmd("FFau3.xpath.value=" & $myVar) ;or maybe: _FFCmd("FFau3.xpath.value='" & $myVar & "'") -
FireFox's post in check char in array? was marked as the answer
Hi,
The problem is when you are comparing a number with your input so your input (which is a string) is converted to a number.
As your input can not be converted to a number, it equals 0. Hence it matches the 0 in your array.
To avoid this add quotes to have strings and not numbers.
Br, FireFox.
-
FireFox's post in Finding if a link is clickable was marked as the answer
Local $oNextPage = _IEGetObjById($oIE, "pagnNextLink") If IsObj($oNextPage) = 0 Then ;End reached Else ;... EndIf -
FireFox's post in Aligning text in the code window was marked as the answer
There's a tool included with the SciTE4AutoIt called Tidy, press Ctrl+T and voila