Leaderboard
Popular Content
Showing content with the highest reputation on 06/07/2018 in all areas
-
But you stated that you were finally able to get it to work. If that's true, then minimize the window that you got it to work on and run your script on it.1 point
-
1 point
-
That's precisely the fail case for this approach: unwanted collisions (as I just above). Still you can mitigate some of these issues: Local $sPattern = "^.*?(?:(Renee|Eero|.*dge)|(Chase|Seth|Sean)|(Leonora|Wes|Rid)).*" Local $sReplace = "('$1'=''?0:1)+('$2'=''?0:2)+('$3'=''?0:3)" Local $iGroup = Execute(StringRegExpReplace("Ridge", $sPattern, $sReplace)) MsgBox(0, "Ridge", "Ridge is in group - " & $iGroup)1 point
-
PSexec MSI MST
usera reacted to Earthshine for a topic
try not removing RequireAdmin. Also there should be a log file in the temp directory and you could read that log file and see what went wrong or if you post it I will analyze it1 point -
Try something like, the following to check that the command is correct, I noticed that you didn't have a space between -p and password not sure if this was just a typo. Try with and without #RequireAdmin, can't remember if you have to run CMD as Administrator. #RequireAdmin Global $sUserName="domain\administrator" Global $sPassword="Password1" Global $sCommandLine = @ComSpec & " /c C:\temp\psexec.exe -accepteula -u " & $sUserName & " -p " & $sPassword & ' MsiExec /i "\\shareserver\folder\qa.msi" TRANSFORMS="\\shareserver\Folder\qa.mst" /qn' MsgBox(4096, "Command Line Switch", $sCommandLine) ;~ For debugging purposes RunWait($sCommandLine)1 point
-
I'm bored, so wrote the following example: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $aServer[6][8] ;~ Global Array $aServer[0][0] = 5 ;~ Server Array Count ;~ Server 1 Array Info $aServer[1][0] = Null ;~ Reserved for Server 1 » Label Control Handle $aServer[1][1] = "ServerName1" ;~ Server 1 » Label Text Value $aServer[1][2] = Null ;~ Reserved for Server 1 » Function 1 » Control Handle $aServer[1][3] = "Function 1" ;~ Function 1 » Text Value $aServer[1][4] = $GUI_UNCHECKED ;~ Server 1 » Function 1 » Check Value $aServer[1][5] = Null ;~ Reserved for Server 1 » Function 2 » Control Handle $aServer[1][6] = "Function 2" ;~ Function 2 » Text Value $aServer[1][7] = $GUI_UNCHECKED ;~ Server 1 » Function 2 » Check Value ;~ Server 2 Array Info $aServer[2][0] = Null ;~ Reserved for Server 2 » Label Control Handle $aServer[2][1] = "ServerName2" ;~ Server 2 » Label Text Value $aServer[2][2] = Null ;~ Reserved for Server 2 » Function 1 » Control Handle $aServer[2][3] = "Function 1" ;~ Function 1 » Text Value $aServer[2][4] = $GUI_UNCHECKED ;~ Server 2 » Function 1 » Check Value $aServer[2][5] = Null ;~ Reserved for Server 2 » Function 2 » Control Handle $aServer[2][6] = "Function 2" ;~ Function 2 » Text Value $aServer[2][7] = $GUI_UNCHECKED ;~ Server 2 » Function 2 » Check Value ;~ Server 3 Array Info $aServer[3][0] = Null ;~ Reserved for Server 3 » Label Control Handle $aServer[3][1] = "ServerName3" ;~ Server 3 » Label Text Value $aServer[3][2] = Null ;~ Reserved for Server 3 » Function 1 » Control Handle $aServer[3][3] = "Function 1" ;~ Function 1 » Text Value $aServer[3][4] = $GUI_UNCHECKED ;~ Server 3 » Function 1 » Check Value - Not $aServer[3][5] = Null ;~ Reserved for Server 3 » Function 2 » Control Handle $aServer[3][6] = "Function 2" ;~ Function 2 » Text Value $aServer[3][7] = $GUI_UNCHECKED ;~ Server 3 » Function 2 » Check Value ;~ Server 4 Array Info $aServer[4][0] = Null ;~ Reserved for Server 4 » Label Control Handle $aServer[4][1] = "ServerName4" ;~ Server 4 » Label Text Value $aServer[4][2] = Null ;~ Reserved for Server 4 » Function 1 » Control Handle $aServer[4][3] = "Function 1" ;~ Function 1 » Text Value $aServer[4][4] = $GUI_UNCHECKED ;~ Server 4 » Function 1 » Check Value $aServer[4][5] = Null ;~ Reserved for Server 4 » Function 2 » Control Handle $aServer[4][6] = "Function 2" ;~ Function 2 » Text Value $aServer[4][7] = $GUI_UNCHECKED ;~ Server 4 » Function 2 » Check Value ;~ Server 5 Array Info $aServer[5][0] = Null ;~ Reserved for Server 5 » Label Control Handle $aServer[5][1] = "ServerName5" ;~ Server 5 » Label Text Value $aServer[5][2] = Null ;~ Reserved for Server 5 » Function 1 » Control Handle $aServer[5][3] = "Function 1" ;~ Function 1 » Text Value $aServer[5][4] = $GUI_UNCHECKED ;~ Server 5 » Function 1 » Check Value $aServer[5][5] = Null ;~ Reserved for Server 5 » Function 2 » Control Handle $aServer[5][6] = "Function 2" ;~ Function 2 » Text Value $aServer[5][7] = $GUI_UNCHECKED ;~ Server 5 » Function 2 » Check Value #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) ;~ Server 1 Controls $aServer[1][0] = GUICtrlCreateLabel($aServer[1][1], 150, 72, 100, 17) $aServer[1][2] = GUICtrlCreateCheckbox($aServer[1][3], 288, 72, 97, 17) GUICtrlSetState(-1, $aServer[1][4]) $aServer[1][5] = GUICtrlCreateCheckbox($aServer[1][6], 392, 72, 97, 17) GUICtrlSetState(-1, $aServer[1][7]) ;~ Server 2 Controls $aServer[2][0] = GUICtrlCreateLabel($aServer[2][1], 150, 95, 100, 17) $aServer[2][2] = GUICtrlCreateCheckbox($aServer[2][3], 288, 96, 97, 17) GUICtrlSetState(-1, $aServer[2][4]) $aServer[2][5] = GUICtrlCreateCheckbox($aServer[2][6], 392, 96, 97, 17) GUICtrlSetState(-1, $aServer[2][4]) ;~ Server 3 Controls $aServer[3][0] = GUICtrlCreateLabel($aServer[3][1], 150, 119, 100, 17) $aServer[3][2] = GUICtrlCreateCheckbox($aServer[3][3], 288, 120, 97, 17) GUICtrlSetState(-1, $aServer[3][4]) $aServer[3][5] = GUICtrlCreateCheckbox($aServer[3][6], 392, 120, 97, 17) GUICtrlSetState(-1, $aServer[3][7]) ;~ Server 4 Controls $aServer[4][0] = GUICtrlCreateLabel($aServer[4][1], 150, 144, 100, 17) $aServer[4][2] = GUICtrlCreateCheckbox($aServer[4][3], 288, 144, 97, 17) GUICtrlSetState(-1, $aServer[4][4]) $aServer[4][5] = GUICtrlCreateCheckbox($aServer[4][6], 392, 144, 97, 17) GUICtrlSetState(-1, $aServer[4][7]) ;~ Server 5 Controls $aServer[5][0] = GUICtrlCreateLabel($aServer[5][1], 150, 170, 100, 17) $aServer[5][2] = GUICtrlCreateCheckbox($aServer[5][3], 288, 170, 97, 17) GUICtrlSetState(-1, $aServer[5][4]) $aServer[5][5] = GUICtrlCreateCheckbox($aServer[5][6], 392, 170, 97, 17) GUICtrlSetState(-1, $aServer[5][7]) $Start = GUICtrlCreateButton("Start", 240, 248, 147, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start GUICtrlSetState($Start, $GUI_DISABLE) For $i = 1 To $aServer[0][0] ;~ Check Function 1 Checked If BitAND(GUICtrlRead($aServer[$i][2]), $GUI_CHECKED) = $GUI_CHECKED Then $aServer[$i][4] = $GUI_CHECKED Function1($aServer[$i][1]) Else $aServer[$i][4] = $GUI_UNCHECKED EndIf ;~ Check Function 2 Checked If BitAND(GUICtrlRead($aServer[$i][5]), $GUI_CHECKED) = $GUI_CHECKED Then $aServer[$i][7] = $GUI_CHECKED Function2($aServer[$i][1]) Else $aServer[$i][7] = $GUI_UNCHECKED EndIf Next GUICtrlSetState($Start, $GUI_ENABLE) EndSwitch WEnd Func Function1($_sServerName) MsgBox(4096, "Function 1", "Executing Function 1 for " & $_sServerName, 5) EndFunc Func Function2($_sServerName) MsgBox(4096, "Function 2", "Executing Function 2 for " & $_sServerName, 5) EndFunc1 point
-
Actually you don't need any kind of flag, you can do it with a simple adlib. #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> Global $hTreeView, $iDoubleClickSpeed = DllCall('user32.dll','uint','GetDoubleClickTime')[0] $hMain = GUICreate('Example') $hTreeView = GUICtrlCreateTreeView(10,10,380,380) For $i = 1 To 10 GUICtrlCreateTreeViewItem('Item ' & $i,$hTreeView) Next GUISetState(@SW_SHOW, $hMain) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") Do Sleep(10) Until GUIGetMsg() = -3 Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndTreeview $hWndTreeview = GUICtrlGetHandle($hTreeView) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndTreeview Switch $iCode Case $NM_CLICK AdlibRegister('LeftClickEvent',$iDoubleClickSpeed) Return 0 Case $NM_DBLCLK DoubleLeftClickEvent() Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func LeftClickEvent() AdlibUnRegister('LeftClickEvent') ConsoleWrite('Left click' & @CRLF) EndFunc Func DoubleLeftClickEvent() AdlibUnRegister('LeftClickEvent') ConsoleWrite('Double left click' & @CRLF) EndFunc1 point
-
tatane, Looks good to me. You can determine the currently set doubleclick delay using: RegRead("HKCU\Control Panel\Mouse","DoubleClickSpeed" M231 point
-
_FileListToArray help needed
VollachR reacted to behdadsoft for a topic
Hi. You should use _FileListToArrayRec and can add custom filter to only record .ini files.1 point -
tatane, When you detect a single click set a flag and start an Adlib check for a suitable time later (it must be a longer interval than the Windows limit for double clicks). If you then get a double click and the flag is set for a single, clear the flag and action the doubleclick code. When the Adlib fires if the flag is set, action the single click code. I have to go out shortly - I will try and produce something to show this in action when I return this afternoon. M231 point
-
BigDaddyO, The return from _GUICtrlMarquee_Create is a simple 0/1 (as explained in the function header) so you cannot set an event to the marquee itself. What you can do is look for a click on the GUI which contains the marquee - like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include "Marquee.au3" Opt("GUIOnEventMode", 1) Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 3) Global $aMarquee_Coords[4] = [0, 0, @DesktopWidth, 30] Global $aMarquee[8] Global $sText = "(UserID) has been added to the AD group_________Click to dismiss this alert" Find_Taskbar($aMarquee_Coords, $aMarquee_Coords[3]) ;Look for the TaskBar ; Create ticker $hGUI = GUICreate("Marquee Example 2", $aMarquee_Coords[2], $aMarquee_Coords[3], $aMarquee_Coords[0], $aMarquee_Coords[1], $WS_POPUPWINDOW, $WS_EX_TOPMOST) $aMarquee[7] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[7], 0, Default, "left", Default, 80) _GUICtrlMarquee_SetDisplay($aMarquee[7], 1, "white", "black", 14, "Comic Sans MS") $oMarquee = _GUICtrlMarquee_Create($aMarquee[7], $sText, 0, 0, $aMarquee_Coords[2], $aMarquee_Coords[3]) GUISetOnEvent($GUI_EVENT_PRIMARYUP, "On_Exit", $hGUI) ; Look for a primary mouse button up on the GUI GUISetState() ; Create the tray menu, this is just for testing since click to close won't work yet TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "On_Exit") TraySetState() ; main loop While 1 sleep(10) WEnd Func On_Exit() _GUICtrlMarquee_Delete($aMarquee[7]) sleep(2000) ;Just testing to make sure the ticker goes away before closing Exit EndFunc Func Find_Taskbar(ByRef $aMarquee_Coords, $iGUIh = 60) ; Find taskbar and get size Local $aTaskBar_Pos = WinGetPos("[CLASS:Shell_TrayWnd]") ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth $aMarquee_Coords[1] = @DesktopHeight - $aTaskBar_Pos[3] - 100 - $iGUIh Return EndIf ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth $aMarquee_Coords[1] = @DesktopHeight - $aTaskBar_Pos[3] - $iGUIh ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth - $aTaskBar_Pos[2] $aMarquee_Coords[1] = @DesktopHeight - $iGUIh ElseIf $aTaskBar_Pos[2] = @DesktopWidth Then ; Taskbar at TOP so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth $aMarquee_Coords[1] = @DesktopHeight - $iGUIh ElseIf $aTaskBar_Pos[3] = @DesktopHeight Then ; Taskbar at LEFT so coords of the marquee are $aMarquee_Coords[0] = $aTaskBar_Pos[2] $aMarquee_Coords[2] = @DesktopWidth - $aTaskBar_Pos[2] $aMarquee_Coords[1] = @DesktopHeight - $iGUIh EndIf EndFunc That works fine for me. M231 point
-
Help Me FFF Au3 Error
JonnyQuy reacted to JLogan3o13 for a topic
You only answered one of the three questions: WHAT IS FFFX.au3? Is it the FireFox UDF that you have modified? How about a link to where you got it? WHAT STEPS HAVE YOU TAKEN TO TROUBLESHOOT? There is no error checking in your script; all you are doing is sending a MsgBox. Capture the return from the _FFOpenURL function to see what the error is. Help us help you by putting some actual effort into it.1 point -
Why Does ControlClick Unfocus other windows!
HamidZaeri reacted to Juvigy for a topic
You can return the focus to the desired window with Autoit right after the control click. You can also try making the window minimized,invisible or the control enabled/disabled and so on.1 point -
Why Does ControlClick Unfocus other windows!
HamidZaeri reacted to Juvigy for a topic
The control that you are clicking is stealing the focus. Some controls do it because they perform some actions at the background. It is normal.1 point -
Powerful HTTP Server in Pure AutoIt
jvanegmond reacted to ripdad for a topic
I have seen this code section in several scripts over the years, and I just wanted to make clear that you cannot chunk data this way. Once $bData is in the TCPSend buffer, there is nothing else left over to chunk in the above script. TCP internally, will send the data at the pace it's being received on the other end. In order to do a proper chunk, you would need to split the data into sections before sending it. Otherwise, this will suffice to send it all at once - at the same time... Func _HTTP_SendData($hSocket, $bData, $sMimeType, $sReply = "200 OK") Local $sPacket = Binary("HTTP/1.1 " & $sReply & @CRLF & _ "Server: " & $sServerName & @CRLF & _ "Connection: close" & @CRLF & _ "Content-Length: " & BinaryLen($bData) & @CRLF & _; <== Content-Length was misspelled "Content-Type: " & $sMimeType & @CRLF & @CRLF & $bData & @CRLF & @CRLF) TCPSend($hSocket, $sPacket); Send everything at once EndFunc1 point -
Couple of ways: #include <Excel.au3> ;~ Example 1 Local $oExcel = _Excel_Open() $oExcel.ActiveWindow.FreezePanes = False Local $sWorkbook = @ScriptDir & "\FileName.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) $oWorkbook.ActiveSheet.Range("B2").Select $oExcel.ActiveWindow.FreezePanes = True ;~ Example 2 Local $oExcel = _Excel_Open() $oExcel.ActiveWindow.FreezePanes = False Local $sWorkbook = @ScriptDir & "\FileName.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) _Excel_FreezePanes($oExcel, 2, 2) Func _Excel_FreezePanes($oExcel, $iCol = 0, $iRow = 1) If Not IsObj($oExcel) Or ObjName($oExcel, 1) <> "_Application" Then Return $oExcel.ActiveWindow.SplitColumn = $iCol $oExcel.ActiveWindow.SplitRow = $iRow $oExcel.ActiveWindow.FreezePanes = True EndFunc1 point
-
PNG button image
behdadsoft reacted to UEZ for a topic
Use the same technique as shown but disable the background control. #include <Constants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> _GDIPlus_Startup() Global Const $hGUI = GUICreate("Test", 300, 200), $STM_SETIMAGE = 0x0172 Global Const $iPic_Bg = GUICtrlCreatePic("", 0, 0, 1024, 768) GUICtrlSetState(-1, $GUI_DISABLE) SendImageToPicControl("c:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg", $iPic_Bg) Global Const $iPic = GUICtrlCreatePic("", 10, 10, 128, 128) SendImageToPicControl(@ScriptDir & "\StepForwardDisabled.png", $iPic) GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _Exit() Case $iPic MsgBox($MB_APPLMODAL, "Test", "Button was pressed") EndSwitch Until False Func SendImageToPicControl($sImage, $iCtrlID) Local Const $hImage = _GDIPlus_ImageLoadFromFile($sImage) Local Const $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($iCtrlID, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_ImageDispose($hImage) EndFunc Func _Exit() _GDIPlus_Shutdown() GUIDelete() Exit EndFunc Br, UEZ1 point -
Can you digitally sign compiled AutoIt scripts?
boomingranny reacted to Mallie99 for a topic
If I found this post then others will too... It's googlable and it hasn't actually been closed off with the right information... Hehe... This is your public service announcement Next week I'll be announcing the moon landings for those who haven't heard1 point -
Can you digitally sign compiled AutoIt scripts?
boomingranny reacted to Mallie99 for a topic
FYI you can now digitally sign AutoIT Compiled files using SignTool from the .NET Framework SDK.1 point -
How to set the tab size for @TAB
behdadsoft reacted to trancexx for a topic
Aha! I knew this day would come. You have a memory leak in your code. See (it's extremely well commented so that everybody can follow): $sSpace = Chr(Int(Asc(@TAB) / 2) * 8) ; this is your brilliance $vOtherHalfOfTheTab = @TAB / 2 ; you forgot about this completely $vOtherHalfOfTheTab = 0 ; Free memory! Space can't be measured. It's just huge. ... now back from the void(*).1 point -
how to add *.png image to gui
behdadsoft reacted to Szhlopp for a topic
Thank Paulia for this=) #include <GDIPlus.au3> #include <GuiConstantsEx.au3> Opt("MustDeclareVars", 1) ; =============================================================================================================================== ; Description ...: Shows how to display a PNG image ; Author ........: Paul Campbell (PaulIA) ; Notes .........: ; =============================================================================================================================== ; =============================================================================================================================== ; Global variables ; =============================================================================================================================== Global $hGUI, $hImage, $hGraphic ; Create GUI $hGUI = GUICreate("Show PNG", 240, 240) GUISetState() ; Load PNG image _GDIPlus_StartUp() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Images\Torus.png") ; Draw PNG image $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) ; Loop until user exits do until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_ShutDown()1 point -
Need help with Color
behdadsoft reacted to cmattb for a topic
The website I use alot for colors is http://html-color-codes.com/. All you have to do is add the 0x before the code. So white is 0xFFFFFF. Orange would be 0xFF9933 or one of the other shades.1 point