Recently Browsing 0 members
No registered users viewing this page.
hello autoit team
is there any wey to check if any process run as admin or no?
i mean e.g if i want to restart any process, now i have the ability to get the process path and commands line
what i need is a wey to check if the process was runing as admin or no to restart it with the same state.
here is the part that am using it to restart the process
func _processRestart($i_pid, $s_ProcessPath) if not (ProcessExists($i_ProcessPid)) then return SetError(1, 0, -1) local $s_ProcessWorkDir = _WinAPI_GetProcessWorkingDirectory($i_ProcessPid) ProcessClose($i_ProcessPid) ProcessWaitClose($i_ProcessPid) ProcessWait(ShellExecute($i_pid,"", $s_ProcessWorkDir)) ProcessesGetList() return true endFunc thanks in advance
First, watch the screenshot I attached:
The background beneath the radios is that a value is subtracted from Player 1, and added to player 2, in the case of the screenshot I made.
You can see that I created 2 radio groups. On the upper part, radio 1 and 2, and on the lower part radio 5 and 6. Now I automated the buttons in such a way ,that when in group 1 player 1 is selected, player 2 in group 2 automatically gets checked for you. Same thing when checking player 2 in the upper part: player 1 gets checked on the lower part. I did this because there is no reason selecting player 1 or 2 twice, because nothing will change. Now that runs smoothly using this script:
If GUICtrlRead($Radio1)=1 And Not BitAND(GUICtrlGetState($Radio6),1) And Not BitAND(GUICtrlGetState($Radio5),1) Then GUICtrlSetState($Radio6,1) If GUICtrlRead($Radio2)=1 And Not BitAND(GUICtrlGetState($Radio5),1) And Not BitAND(GUICtrlGetState($Radio6),1) Then GUICtrlSetState($Radio5,1) If GUICtrlRead($Radio5)=1 And Not BitAND(GUICtrlGetState($Radio2),1) And Not BitAND(GUICtrlGetState($Radio1),1) Then GUICtrlSetState($Radio2,1) If GUICtrlRead($Radio6)=1 And Not BitAND(GUICtrlGetState($Radio1),1) And Not BitAND(GUICtrlGetState($Radio2),1) Then GUICtrlSetState($Radio1,1) But there is a problem when clicking on a radio in group 2, the lower one. It is very hard to check one, because for some reason the radio get's deselected instantly most of the time. I already tried to prevent it by using the second BitAND() in the codes I shared (It doesn't check the radio automatically if the other radio in the other group is selected, meaning that the user want's to switch the radios). But it didn't work.
Does somebody know why you sometimes can't check radio 5 or 6 (the lower part)?
i have searched a lot about how to run external programs with the administrator privileges without the script running with administrator privileges using autoit
But all my attempts failed
Finally, today I found the VBS function doing this task
I immediately transferred it to our beloved language (autoit) and i decided to share it with you
i hope you like it
This is a simple example about how to use the function
runAsAdmin("cmd.exe", "/c @echo off & cls & echo test & pause", "c:\", @sw_show)
this is the function
func runAsAdmin($program, $parameters = "", $workingDir = @workingDir, $show = "") local $oShell = OBJCreate("Shell.Application") if isOBJ($oShell) then local $result = $oShell.ShellExecute($program, $parameters, $workingDir, "runas", $show) else $result = false endIf return $result endFunc
Detect if the focus item is a button or check box
My dears I have a problem
When I try to use
it doesn't recognize the check boxes.
The result is that the selector is a button
Although the specified is a check box
but I want a way to identify the check boxes.
Because I want to make a tool that helps screen readers users
I hope you have the solution.
Thank you in advance.
I created 3 radio buttons and when the script is run, the selected buttons display the text on the right of the actual button. Also, it appears like the radio button occupies space around it, as it obscures part of the other controls when I hover the mouse around it. I would like to group the buttons closer together and put other controls on the right of them. I also wanted to make the button text display on the left side of the button.
Here is my test code:
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode Opt('MustDeclareVars', 1) OnAutoItExitRegister("ExitStageLeft") Opt("GUIEventOptions", 1) ;0=default, 1=just notification, 2=GuiCtrlRead tab index _Main() Func _Main() GUICreate("test", 300, 300, -1, -1, -1, -1) GUIStartGroup() local $x = 50, $y = 10, $w = 40, $h = 15,$spcY = 15 GUICtrlCreateRadio("", $x, $y, $w, $h) GUICtrlCreateRadio("ABC", $x, $y + ($spcY*1), $w, $h) GUICtrlCreateRadio("", $x, $y + ($spcY*2), $w, $h) GUIStartGroup() GUICtrlCreateInput("An Input Control", 70, 10, 110, 30) GUICtrlCreateInput("Another Input Control", 10, 73, 110, 20) GUISetOnEvent(-3, 'ExitStageLeft') GUISetState(@SW_SHOW) While (1) Sleep(251) WEnd EndFunc Func ExitStageLeft() Exit EndFunc I want "ABC" to display on the left of the 2nd radio button.