Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/24/2022 in all areas

  1. Hello everyone. i am using an application that requires cURL input to be able to run the program. currently it takes time to get cURL manually, is there any way I can get cURL quickly? i can login the website using webdriver
    1 point
  2. Should be easy... as described in the helpfile: Filewrite ($Files, '"') ; or Filewrite ($Files, """")
    1 point
  3. TheXman

    Background Remover help

    If you're executing that command line using PowerShell, then it will work just fine because it accepts strings wrapped in single quotes or double quotes. If you are executing that command using CMD, then you will need to use double quotes instead of single quotes.
    1 point
  4. Finally got a number !!! At that level, there is no need to embark in using a RDBMS. In the very very long run, you may wish to convert it to a DB, but for now, let just stay with a single txt file well organized. With a SRE perfectly adapted to your request, it will take about 1 ms to get the answer. So for now, you will need to prepare for us a few of those real questions based on a real repertory of knowledge (not just test and useless stuff) and the real expected result. Based on that, we will be able to provide some guidances and maybe a startup code for you.
    1 point
  5. Nine

    msg box help

    Here another way, just want to let you know. #include <WinAPISys.au3> #include <WinAPIConstants.au3> #include <WinAPIProc.au3> Global $hProcMsgBox = DllCallbackRegister(CbtHookProcMsgBox, "int", "int;int;int") Global $hHookMsgBox = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProcMsgBox), 0, _WinAPI_GetCurrentThreadId()) Local $iRet = MsgBox(0, "test", "test") ConsoleWrite ($iRet & @CRLF) _WinAPI_UnhookWindowsHookEx($hHookMsgBox) DllCallbackFree($hProcMsgBox) Func CbtHookProcMsgBox($nCode, $wParam, $lParam) If $nCode = 5 Then WinMove (HWnd($wParam), "", 0, 0) Return _WinAPI_CallNextHookEx($hHookMsgBox, $nCode, $wParam, $lParam) EndFunc ;==>CbtHookProcMsgBox
    1 point
  6. I simply edited your Test.au3 script to fit @trancexx's GIFAnimation.au3 udf and it seems like no problem is occurring. ; #include <.\Data\_GUIResourcePic.au3> #include ".\Data\GIFAnimation.au3" Global $arrayImages[4] = [Null, Null, Null, Null] Global $index = 1 Global $hGUI = GUICreate("TEST", 800, 600, -1, -1) Global $next = GUICtrlCreateButton("NEXT", 750, 570, 50, 30) ; $arrayImages[$index] = _GUICtrlPic_Create(@ScriptDir & "\" & $index & ".gif", 0, 0, 750, 600) ;, $GIS_ASPECTRATIOFIX) $arrayImages[$index] = _GUICtrlCreateGIF(@ScriptDir & "\" & $index & ".gif", '', 0, 0, 750, 600) ;, $GIS_ASPECTRATIOFIX) GUISetState() While 1 Switch GUIGetMsg() Case -3 ; $GUI_EVENT_CLOSE ExitLoop Case $next _ShowNextGIF($index) EndSwitch WEnd Func _ShowNextGIF($i) ; _GUICtrlPic_Delete($arrayImages[$i]) ; Delete the previous image _GIF_DeleteGIF($arrayImages[$i]) $arrayImages[$i] = Null Sleep(5) $i = $i + 1 ; Increase the index of the image to show If $i > 3 Then $i = 1 ; If the index is bigger than the number of images that we want to show, we do reset the count $arrayImages[$i] = _GUICtrlCreateGIF(@ScriptDir & "\" & $i & ".gif", '', 0, 0, 750, 600) ;, $GIS_ASPECTRATIOFIX) $index = $i EndFunc ;==>_ShowNextGIF
    1 point
  7. @Qwerty212 Did you think of creating like 3-4 resized versions of each GIF, so it can fit the area of your choice ? It takes only a few seconds to create a new resized GIF. Then depending of the size of the screen you can pick the appropriate GIF.
    1 point
  8. Gianni

    Button Deck

    This roundup of "virtual keyboards" (https://www.buttoncommander.com/en/input-devices/difference-between-hotkeyboard-devices-and-keyboard-devices/) inspired me to create this simple "LaunchPad" script. with this script you can easily create panels with buttons for starting programs, but not only, you can also associate macros, shortcuts, functions with the buttons ... In short, the $aTools 2D array contains the settings that determine the behavior of each "Button", namely 4 parameters for each row (for each button); [n][0] the tooltip of the button [n][1] path of an icon or a file containing icons [n][2] the number of the icon (if the previous parameter is a collection) [n][3] AutoIt command(s) to be executed directly on button click (or also the name of a function) (see the script for some examples of use) If you have ideas for new records for that array you are encouraged to post it here (thanks) You can easily change the buttons dimensions and the shape of the initial deck by changing the $iStep and $iNrPerLine variables in the script (deck is resizeable as well) Credits: This script makes use of some useful snippets kindly provided by @KaFu, @Danyfirex and @mikell (see the comments in the script for references) Tips (or ready made modifications) for improvements are as always welcome. have fun ; =============================================================================================================================== ; Title .........: LaunchPad ; Description ...: button deck to be used as an applications launcher (and not only) ; Author(s) .....: Chimp (Gianni Addiego) ; credits to @KaFu, @Danyfirex, @mikell (see comments for references) ; =============================================================================================================================== #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> ; <WinAPISysWin.au3> #include <SendMessage.au3> #include <WinAPIFiles.au3> ;Turn off redirection for a 32-bit script on 64-bit system. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) ; https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-sizing Global Const $WMSZ_LEFT = 1 Global Const $WMSZ_RIGHT = 2 Global Const $WMSZ_TOP = 3 Global Const $WMSZ_TOPLEFT = 4 Global Const $WMSZ_TOPRIGHT = 5 Global Const $WMSZ_BOTTOM = 6 Global Const $WMSZ_BOTTOMLEFT = 7 Global Const $WMSZ_BOTTOMRIGHT = 8 Global Enum $vButton_Tip = 0, $vButton_IconPath, $vButton_IconNumber, $vButton_Command #cs The following 2D array contains the settings that determine the behavior of each "Button" namely 4 parameters for each row (for each button); [n][0] the tooltip of the button [n][1] path of an icon or a file containing icons [n][2] the number of the icon (if the previous parameter is a collection) [n][3] AutoIt command(s) to be executed directly on button click (or also the name of a function) #ce Global Const $aTools[][] = [ _ ['Settings', 'SHELL32.dll', 177, 'run("explorer.exe shell:::{D20EA4E1-3957-11d2-A40B-0C5020524153}")'], _ ; 'Test()'], _ ; call a function 'Test()' ['Windows version', 'winver.exe', 1, 'run("explorer.exe shell:::{BB06C0E4-D293-4f75-8A90-CB05B6477EEE}")'], _ ; or "Run('winver.exe')" ['This computer', 'netcenter.dll', 6, 'run("explorer.exe shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")'], _ ['Devices and Printers', 'SHELL32.dll', 272, 'run("explorer.exe shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}")'], _ ['Folder options', 'SHELL32.dll', 210, 'run("explorer.exe shell:::{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}")'], _ ['Command Prompt', @ComSpec, 1, 'Run(@ComSpec)'], _ ['Internet Explorer', @ProgramFilesDir & '\Internet Explorer\iexplore.exe', 1, "Run(@ProgramFilesDir & '\Internet Explorer\iexplore.exe')"], _ ['Media Player', @ProgramFilesDir & '\Windows media player\wmplayer.exe', 1, "Run(@ProgramFilesDir & '\Windows media player\wmplayer.exe')"], _ ['File browser', @WindowsDir & '\explorer.exe', 1, "Run(@WindowsDir & '\explorer.exe')"], _ ['Notepad', @SystemDir & '\notepad.exe', 1, "Run(@SystemDir & '\notepad.exe')"], _ ['Wordpad', @SystemDir & '\write.exe', 1, "Run(@SystemDir & '\write.exe')"], _ ['Registry editor', @SystemDir & '\regedit.exe', 1, "ShellExecute('regedit.exe')"], _ ['Connect to', 'netcenter.dll', 19, 'run("explorer.exe shell:::{38A98528-6CBF-4CA9-8DC0-B1E1D10F7B1B}")'], _ ['Calculator', @SystemDir & '\Calc.exe', 1, "Run(@SystemDir & '\calc.exe')"], _ ['Control panel', 'control.exe', 1, 'run("explorer.exe shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}")'], _ ['Users manager', @SystemDir & '\Netplwiz.exe', 1, "ShellExecute('Netplwiz.exe')"], _ ; {7A9D77BD-5403-11d2-8785-2E0420524153} ['Run', 'SHELL32.dll', 25, 'Run("explorer.exe Shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}")'], _ ['Search files', 'SHELL32.dll', 135, 'run("explorer.exe shell:::{9343812e-1c37-4a49-a12e-4b2d810d956b}")'], _ ['On screen Magnifier', @SystemDir & '\Magnify.exe', 1, "ShellExecute('Magnify.exe')"], _ ['Paint', @SystemDir & '\mspaint.exe', 1, "Run(@SystemDir & '\mspaint.exe')"], _ ['Remote desktop', @SystemDir & '\mstsc.exe', 1, " Run('mstsc.exe')"], _ ['Resource monitoring', @SystemDir & '\resmon.exe', 1, "Run('resmon.exe')"], _ ['Device manager', 'SHELL32.dll', 13, 'Run("explorer.exe Shell:::{74246bfc-4c96-11d0-abef-0020af6b0b7a}")'], _ ['Audio', 'SndVol.exe', 1, 'Run("explorer.exe Shell:::{F2DDFC82-8F12-4CDD-B7DC-D4FE1425AA4D}")'], _ ; or 'run(@SystemDir & "\SndVol.exe")'] ['Task view', 'SHELL32.dll', 133, 'Run("explorer.exe shell:::{3080F90E-D7AD-11D9-BD98-0000947B0257}")'], _ ['Task Manager', @SystemDir & '\taskmgr.exe', 1, 'Send("^+{ESC}")'], _ ; "Run(@SystemDir & '\taskmgr.exe')"], _ ['On Screen Keyboard', 'osk.exe', 1, 'ProcessExists("osc.exe") ? False : ShellExecute("osk.exe")'], _ ; <-- ternary example ['... if Notepad is running' & @CRLF & 'Send F5 to it', 'SHELL32.dll', 167, ' WinExists("[CLASS:Notepad]") ? ControlSend("[CLASS:Notepad]", "", "", "{F5}") : MsgBox(16, ":(", "Notepad not found", 2)'] _ ; Check if Notepad is currently running ] ; Show desktop {3080F90D-D7AD-11D9-BD98-0000947B0257} ; Desktop Background {ED834ED6-4B5A-4bfe-8F11-A626DCB6A921} ; IE internet option {A3DD4F92-658A-410F-84FD-6FBBBEF2FFFE} ; ['Notes', 'StikyNot.exe', 1, "ShellExecute('StikyNot')"], _ Global $iStep = 38 ; button size Global $iNrPerLine = 2 Global $iNrOfLines = Ceiling(UBound($aTools) / $iNrPerLine) Global $GUI = GUICreate('LaunchPad', 10, 10, 20, 20, BitOR($WS_THICKFRAME, 0), BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) Global $aMyMatrix = _GuiControlPanel("Button", $iNrPerLine, $iNrOfLines, $iStep, $iStep, BitOR(0x40, 0x1000), -1, 0, 0, 0, 0, 0, 0, False, "") Global $iPreviousX = ($aMyMatrix[0])[1], $iPreviousY = ($aMyMatrix[0])[2] For $i = 1 To UBound($aMyMatrix) - 1 GUICtrlSetResizing($aMyMatrix[$i], $GUI_DOCKALL) ; (2+32+256+512) so the control will not move during resizing If $i <= UBound($aTools) Then GUICtrlSetImage($aMyMatrix[$i], $aTools[$i - 1][$vButton_IconPath], $aTools[$i - 1][$vButton_IconNumber]) GUICtrlSetTip($aMyMatrix[$i], $aTools[$i - 1][$vButton_Tip]) EndIf Next _WinSetClientSize($GUI, ($aMyMatrix[0])[11], ($aMyMatrix[0])[12]) ; thanks to KaFu GUISetState() ; https://devblogs.microsoft.com/oldnewthing/20110218-00/?p=11453 GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUIRegisterMsg($WM_SIZING, "WM_SIZING") _MainLoop() Exit Func _MainLoop() Local $iDeltaX, $iDeltaY, $row, $col, $left, $top While 1 $Msg = GUIGetMsg() Switch $Msg Case -3 ; end Exit Case Else For $i = 1 To UBound($aMyMatrix) - 1 If $Msg = $aMyMatrix[$i] Then If $i <= UBound($aTools) Then $dummy = Execute($aTools[$i - 1][3]) EndIf EndIf Next EndSwitch ; check if any size has changed If $iPreviousX <> ($aMyMatrix[0])[1] Or $iPreviousY <> ($aMyMatrix[0])[2] Then ; calculate the variations $iDeltaX = Abs($iPreviousX - ($aMyMatrix[0])[1]) $iDeltaY = Abs($iPreviousY - ($aMyMatrix[0])[2]) ; if both dimensions changed at the same time, the largest variation prevails over the other If $iDeltaX >= $iDeltaY Then ; keep the new number of columns ; calculate and set the correct number of lines accordingly _SubArraySet($aMyMatrix[0], 2, Ceiling((UBound($aMyMatrix) - 1) / ($aMyMatrix[0])[1])) Else ; otherwise keep the new number of rows ; calculate and set the correct number of columns accordingly _SubArraySet($aMyMatrix[0], 1, Ceiling((UBound($aMyMatrix) - 1) / ($aMyMatrix[0])[2])) EndIf ; set client area new sizes _WinSetClientSize($GUI, ($aMyMatrix[0])[1] * $iStep, ($aMyMatrix[0])[2] * $iStep) ; remember the new panel settings $iPreviousX = ($aMyMatrix[0])[1] $iPreviousY = ($aMyMatrix[0])[2] ; rearrange the controls inside the panel For $i = 0 To UBound($aMyMatrix) - 2 ; coordinates 1 based $col = Mod($i, $iPreviousX) + 1 ; Horizontal position within the grid (column) $row = Int($i / $iPreviousX) + 1 ; Vertical position within the grid (row number) $left = ($aMyMatrix[0])[5] + (((($aMyMatrix[0])[3] + ($aMyMatrix[0])[9]) * $col) - ($aMyMatrix[0])[9]) - ($aMyMatrix[0])[3] + ($aMyMatrix[0])[7] $top = ($aMyMatrix[0])[6] + (((($aMyMatrix[0])[4] + ($aMyMatrix[0])[10]) * $row) - ($aMyMatrix[0])[10]) - ($aMyMatrix[0])[4] + ($aMyMatrix[0])[8] GUICtrlSetPos($aMyMatrix[$i + 1], $left, $top) Next EndIf WEnd EndFunc ;==>_MainLoop ; Allow/Disallow specific borders resizing ; thanks to Danyfirex ; --------- ; https://www.autoitscript.com/forum/topic/201464-partially-resizable-window-how-solved-by-danyfirex-%F0%9F%91%8D/?do=findComment&comment=1445748 Func WM_NCHITTEST($hwnd, $iMsg, $iwParam, $ilParam) If $hwnd = $GUI Then Local $iRet = _WinAPI_DefWindowProc($hwnd, $iMsg, $iwParam, $ilParam) ; https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest If $iRet = $HTBOTTOM Or $iRet = $HTRIGHT Or $iRet = $HTBOTTOMRIGHT Then ; allowed resizing Return $iRet ; default process of border resizing Else ; resizing not allowed Return $HTCLIENT ; do like if cursor is in the client area EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCHITTEST ; controls and process resizing operations in real time ; thanks to mikell ; ------ ; https://www.autoitscript.com/forum/topic/201464-partially-resizable-window-how-solved-by-danyfirex-%F0%9F%91%8D/?do=findComment&comment=1445754 Func WM_SIZING($hwnd, $iMsg, $wparam, $lparam) ; https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-sizing Local $iCols = ($aMyMatrix[0])[1] Local $iRows = ($aMyMatrix[0])[2] Local $xClientSizeNew, $yClientSizeNew #cs $wparam The edge of the window that is being sized. $lparam A pointer to a RECT structure with the screen coordinates of the drag rectangle. To change the size or position of the drag rectangle, an application must change the members of this structure. Return value Type: LRESULT #ce $wparam $aPos = WinGetPos($GUI) #cs Success : a 4 - element array containing the following information : $aArray[0] = X position $aArray[1] = Y position $aArray[2] = Width #ce Success : a 4 - element array containing the following information : $aPos2 = WinGetClientSize($GUI) #cs Success: a 2-element array containing the following information: $aArray[0] = Width of window's client area #ce Success: a 2-element array containing the following information: ; https://docs.microsoft.com/en-us/previous-versions//dd162897(v=vs.85) Local $sRect = DllStructCreate("Int[4]", $lparam) ; outer dimensions (includes borders) Local $left = DllStructGetData($sRect, 1, 1) Local $top = DllStructGetData($sRect, 1, 2) Local $Right = DllStructGetData($sRect, 1, 3) Local $bottom = DllStructGetData($sRect, 1, 4) ; border width Local $iEdgeWidth = ($aPos[2] - $aPos2[0]) / 2 Local $iHeadHeigth = $aPos[3] - $aPos2[1] - $iEdgeWidth * 2 Local $aEdges[2] $aEdges[0] = $aPos[2] - $aPos2[0] ; x $aEdges[1] = $aPos[3] - $aPos2[1] ; y $xClientSizeNew = $Right - $left - $aEdges[0] $xClientSizeNew = Round($xClientSizeNew / $iStep) * $iStep $yClientSizeNew = $bottom - $top - $aEdges[1] $yClientSizeNew = Round($yClientSizeNew / $iStep) * $iStep Switch $wparam Case $WMSZ_RIGHT ; calculate the new position of the right border DllStructSetData($sRect, 1, $left + $xClientSizeNew + $aEdges[0], 3) Case $WMSZ_BOTTOM ; calculate the new position of the bottom border DllStructSetData($sRect, 1, $top + $yClientSizeNew + $aEdges[1], 4) Case $WMSZ_BOTTOMRIGHT ; calculate the new position of both borders DllStructSetData($sRect, 1, $left + $xClientSizeNew + $aEdges[0], 3) DllStructSetData($sRect, 1, $top + $yClientSizeNew + $aEdges[1], 4) EndSwitch #cs If DllStructGetData($sRect, 1, 3) > @DesktopWidth Then ; $Right DllStructSetData($sRect, 1, DllStructGetData($sRect, 1, 3) - $iStep, 3) $xClientSizeNew -= $iStep EndIf If DllStructGetData($sRect, 1, 4) > @DesktopHeight Then ; $bottom DllStructSetData($sRect, 1, DllStructGetData($sRect, 1, 4), 4) $yClientSizeNew -= $iStep #ce If DllStructGetData($sRect, 1, 3) > @DesktopWidth Then ; $Right ; check if number of rows has changed If $iRows <> $yClientSizeNew / $iStep Then _SubArraySet($aMyMatrix[0], 2, $yClientSizeNew / $iStep) EndIf ; check if number of columns has changed If $iCols <> $xClientSizeNew / $iStep Then _SubArraySet($aMyMatrix[0], 1, $xClientSizeNew / $iStep) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZING ; set client area new sizes ; thanks to KaFu ; ---- ; https://www.autoitscript.com/forum/topic/201524-guicreate-and-wingetclientsize-mismatch/?do=findComment&comment=1446141 Func _WinSetClientSize($hwnd, $iW, $iH) Local $aWinPos = WinGetPos($hwnd) Local $sRect = DllStructCreate("int;int;int;int;") DllStructSetData($sRect, 3, $iW) DllStructSetData($sRect, 4, $iH) _WinAPI_AdjustWindowRectEx($sRect, _WinAPI_GetWindowLong($hwnd, $GWL_STYLE), _WinAPI_GetWindowLong($hwnd, $GWL_EXSTYLE)) WinMove($hwnd, "", $aWinPos[0], $aWinPos[1], $aWinPos[2] + (DllStructGetData($sRect, 3) - $aWinPos[2]) - DllStructGetData($sRect, 1), $aWinPos[3] + (DllStructGetData($sRect, 4) - $aWinPos[3]) - DllStructGetData($sRect, 2)) EndFunc ;==>_WinSetClientSize ; ; #FUNCTION# ==================================================================================================================== ; Name...........: _GuiControlPanel ; Description ...: Creates a rectangular panel with adequate size to contain the required amount of controls ; and then fills it with the same controls by placing them according to the parameters ; Syntax.........: _GuiControlPanel($ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, $style, $exStyle, $xPos = 0, $yPos = 0, $xBorder, $yBorder, $xSpace = 1, $ySpace = 1, $Group = false, , $sGrpTitle = "") ; Parameters ....: $ControlType - Type of controls to be generated ("Button"; "Text"; ..... ; $nrPerLine - Nr. of controls per line in the matrix ; $nrOfLines - Nr. of lines in the matrix ; $ctrlWidth - Width of each control ; $ctrlHeight - Height of each control ; $Style - Defines the style of the control ; $exStyle - Defines the extended style of the control ; $xPanelPos - x Position of panel in GUI ; $yPanelPos - y Position of panel in GUI ; $xBorder - distance from lateral panel's borders to the matrix (width of left and right margin) default = 0 ; $yBorder - distance from upper and lower panel's borders to the matrix (width of upper and lower margin) default = 0 ; $xSpace - horizontal distance between the controls ; $ySpace - vertical distance between the controls ; $Group - if you want to group the controls (true or false) ; $sGrpTitle - title of the group (ignored if above is false) ; Return values .: an 1 based 1d array containing references to each control ; element [0] contains an 1d array containing various parameters about the panel ; Author ........: Gianni Addiego (Chimp) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _GuiControlPanel($ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, $style = -1, $exStyle = -1, $xPanelPos = 0, $yPanelPos = 0, $xBorder = 0, $yBorder = 0, $xSpace = 1, $ySpace = 1, $Group = False, $sGrpTitle = "") Local Static $sAllowedControls = "|Label|Input|Edit|Button|CheckBox|Radio|List|Combo|Pic|Icon|Graphic|" If Not StringInStr($sAllowedControls, '|' & $ControlType & '|') Then Return SetError(1, 0, "Unkown control") Local $PanelWidth = (($ctrlWidth + $xSpace) * $nrPerLine) - $xSpace + ($xBorder * 2) Local $PanelHeight = (($ctrlHeight + $ySpace) * $nrOfLines) - $ySpace + ($yBorder * 2) Local $hGroup If $Group Then If $sGrpTitle = "" Then $xPanelPos += 1 $yPanelPos += 1 $hGroup = GUICtrlCreateGroup("", $xPanelPos - 1, $yPanelPos - 7, $PanelWidth + 2, $PanelHeight + 8) Else $xPanelPos += 1 $yPanelPos += 15 $hGroup = GUICtrlCreateGroup($sGrpTitle, $xPanelPos - 1, $yPanelPos - 15, $PanelWidth + 2, $PanelHeight + 16) EndIf EndIf ; create the controls Local $aGuiGridCtrls[$nrPerLine * $nrOfLines + 1] Local $aPanelParams[14] = [ _ $ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, _ $xPanelPos, $yPanelPos, $xBorder, $yBorder, $xSpace, $ySpace, $PanelWidth, $PanelHeight, $hGroup] For $i = 0 To $nrPerLine * $nrOfLines - 1 ; coordinates 1 based $col = Mod($i, $nrPerLine) + 1 ; Horizontal position within the grid (column) $row = Int($i / $nrPerLine) + 1 ; Vertical position within the grid (row) $left = $xPanelPos + ((($ctrlWidth + $xSpace) * $col) - $xSpace) - $ctrlWidth + $xBorder $top = $yPanelPos + ((($ctrlHeight + $ySpace) * $row) - $ySpace) - $ctrlHeight + $yBorder $text = $i + 1 ; "*" ; "." ; "(*)" ; create the control(s) $aGuiGridCtrls[$i + 1] = Execute("GUICtrlCreate" & $ControlType & "($text, $left, $top, $ctrlWidth, $ctrlHeight, $style, $exStyle)") Next If $Group Then GUICtrlCreateGroup("", -99, -99, 1, 1) ; close group $aGuiGridCtrls[0] = $aPanelParams Return $aGuiGridCtrls EndFunc ;==>_GuiControlPanel ; writes a value to an element of an array embedded in another array Func _SubArraySet(ByRef $aSubArray, $iElement, $vValue) $aSubArray[$iElement] = $vValue EndFunc ;==>_SubArraySet Func Test() MsgBox(0, 0, ":)", 1) EndFunc ;==>Test
    1 point
  9. mikell

    Scroll Edit to bottom

    #include <GuiEdit.au3> _GUICtrlEdit_LineScroll($G_Chat, 0, _GUICtrlEdit_GetLineCount($G_Chat))
    1 point
  10. Method 1 Global $Test = 0xFFFFFFFF $PosX = BitAND($Test, 0xFFFF) $PosY = BitShift($Test, 16) If $PosX > 0x7FFF Then $PosX -= 0x10000 If $PosY > 0x7FFF Then $PosY -= 0x10000 MsgBox(0, "HiLoWord Test", "HiWord: " & $PosX & @CRLF & _ "LoWord: " & $PosY & @CRLF)Method 2 Global $Test = 0xFFFFFFFF $tStruct1 = DllStructCreate('dword XY') $tStruct2 = DllStructCreate('short Y;short X', DllStructGetPtr($tStruct1)) DllStructSetData($tStruct1, 'XY', $Test) $PosX = DllStructGetData($tStruct2, 'X') $PosY = DllStructGetData($tStruct2, 'Y') MsgBox(0, "HiLoWord Test", "HiWord: " & $PosX & @CRLF & _ "LoWord: " & $PosY & @CRLF)
    1 point
×
×
  • Create New...