Leaderboard
Popular Content
Showing content with the highest reputation on 10/06/2017 in all areas
-
A simple endless kaleidoscope made on a RichEdit control (hit esc to exit) Idea is from this link: http://www.calormen.com/jsbasic/ select the "Rod's Color Pattern" demo and run it on the Apple 2 emulator on that web page to see the original Apple II version. ; Idea from this link: http://www.calormen.com/jsbasic/ ; get the "Rod's Color Pattern" from the "Select a sample..." combo and run it ; #include <GuiRichEdit.au3> #include <GUIConstants.au3> HotKeySet("{ESC}", "_TheEnd") ; Global $iHwidth = 40, $iVheight = 40; width and height of screen Global $sBuffer = _StringReplay(_StringReplay(" ", $iHwidth + 1) & @CRLF, $iVheight) ;to fill the RichEdit Global $sChar = " " Global Const $aApplesoft_color[16] = [ _ ; LoRes colors in Applesoft basic 0x000000, _ ; 0x0 = 00 = Black 0XFF00FF, _ ; 0x1 = 01 = Magenta 0X0000A0, _ ; 0x2 = 02 = Dark Blue 0X800080, _ ; 0x3 = 03 = Purple 0X006400, _ ; 0x4 = 04 = Dark Green 0X808080, _ ; 0x5 = 05 = Grey 0X0000CD, _ ; 0x6 = 06 = Medium Blue 0XADD8E6, _ ; 0x7 = 07 = Light Blue 0XA52A2A, _ ; 0x8 = 08 = Brown 0XFFA500, _ ; 0x9 = 09 = Orange 0XD3D3D3, _ ; 0xA = 10 = Light Grey 0XFFC0CB, _ ; 0xB = 11 = Pink 0X008000, _ ; 0xC = 12 = Green 0XFFFF00, _ ; 0xD = 13 = Yellow 0X00FFFF, _ ; 0xE = 14 = Aqua 0xFFFFFF]; ; 0xF = 15 = White Global $MyGui = GUICreate("", 335, 630, -1, -1, $WS_POPUPWINDOW, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $WS_EX_COMPOSITED, $WS_EX_LAYERED)) $hGlass = GUICtrlCreateLabel("", 0, 0, 335, 630, -1, $GUI_WS_EX_PARENTDRAG) ; Protect the RichEdit and allows to drag the GUI around GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ; This is like a glass over the underlying RichEdit GUICtrlSetCursor(-1, 2) ; Cursor is an arrow (instead of the default I-beam) ; ; This RichEdit is used to simulate the LoRes Graphic of tha Apple 2 (40x40 pixels) Global $hGR = _GUICtrlRichEdit_Create($MyGui, $sBuffer, 0, 0, 335, 630, BitOR($ES_READONLY, $ES_MULTILINE)) _GUICtrlRichEdit_SetSel($hGR, 0, -1) _GUICtrlRichEdit_SetFont($hGR, 10, "Courier new") _GUICtrlRichEdit_SetBkColor($hGR, 0xffffff) GUISetState() ; Main loop ; --------- While 1 For $W = 3 To 50 For $x = 19 To 1 Step -1 For $y = 19 To 0 Step -1 $xy = $x + $y $iColor = Mod(Int($y * 3 / ($x + 3) + $x * $W / 12), 16) $sChar = ChrW(32 + $iColor) ; comment this if you don't want chars (only color) If $iColor > 15 Then $iColor = 15 Print($sChar, $x, $xy, $iColor) Print($sChar, $xy, $x, $iColor) Print($sChar, 40 - $x, 40 - $xy, $iColor) Print($sChar, 40 - $xy, 40 - $x, $iColor) Print($sChar, $xy, 40 - $x, $iColor) Print($sChar, 40 - $x, $xy, $iColor) Print($sChar, $x, 40 - $xy, $iColor) Print($sChar, 40 - $xy, $x, $iColor) Next Next Next WEnd ; Print a char to Htab (Horiz. pos), Vtab (Vert pos) on the RichEdit ; ------------------------------------------------------------------ Func Print($sChar = "", $iHtab = 1, $iVtab = 1, $iColor = 0xffffff) _GUICtrlRichEdit_SetSel($hGR, GetAbsPos($iHtab, $iVtab), GetAbsPos($iHtab, $iVtab) + 1, True) _GUICtrlRichEdit_SetCharBkColor($hGR, $aApplesoft_color[$iColor]) _GUICtrlRichEdit_ReplaceText($hGR, $sChar, False) EndFunc ;==>Print ; From Htab Vtab (1 based) to Absolute position within the RichEdit ; ----------------------------------------------------------------- Func GetAbsPos($iHtab = 1, $iVtab = 1, $iScreenWidth = $iHwidth) Return ($iVtab - 1) * ($iScreenWidth + 2) + $iHtab EndFunc ;==>GetAbsPos ; returns one or more chars replicated n times ; Example: ConsoleWrite(_StringReplay('*', 5) & @CRLF) Func _StringReplay($sChars = "", $iRepeats = 0) $sChars = String($sChars) $iRepeats = Int(Abs(Number($iRepeats))) Return StringReplace(StringFormat('%' & $iRepeats & 's', ""), " ", $sChars) EndFunc ;==>_StringReplay Func _TheEnd() If WinActive("[ACTIVE]") = $MyGui Then _GUICtrlRichEdit_Destroy($hGR) Exit EndIf EndFunc ;==>_TheEnd8 points
-
Not much we can do to assist with just a screenshot. Give us something that we can use to help you. Post the URL, the HTML, etc.1 point
-
WinAPIEx UDF
pixelsearch reacted to argumentum for a topic
@Matt_Murdoch, as @Melba23 said, it's no longer needed but, there are the files1 point -
WinAPIEx UDF
Matt_Murdoch reacted to Melba23 for a topic
Matt_Murdoch, Welcome to the AutoIt forums. Most of the function in this UDF are now included in the standard AutoIt install, so there is no need to download it. M231 point -
Usually an underscore in front of the function name means it's a user defined function not a native function, but it's just a convention. You can find user defined function without underscore prefix. Anyway it has nothing to do with the functionality, whatever your function is name it runs in the same way.1 point
-
There is no difference, but we tend to use the underscore prefix to indicate that it is an UDF in stead of an internal function. Jos1 point
-
Pretty cool. A GDI+ version would be pretty cool too I imagine1 point
-
For this example of Notepad windows to work for you, your window handles will need to be entered into the array, $aWinHwds. Press Esc key to exit this example when run. #include <Array.au3> HotKeySet("{ESC}", "_Terminate") ; Press Esc key to exit. Global $aWinHwds[6] ; <<<<< Change for the number of windows required. (eg. $aWinHwds[20] will generate 20 windows) Local $iNumOfCols = 4 ; <<<<< Change for number of columns of windows per row on desktop. Local $iWinWidth = Int(@DesktopWidth / $iNumOfCols), $iWinHeight = Int(@DesktopHeight / Ceiling(UBound($aWinHwds) / $iNumOfCols)) For $i = 0 To UBound($aWinHwds) - 1 $iPid = Run("notepad.exe") ProcessWait($iPid) $aWinHwds[$i] = WinGetHandle("", "") ; Add the active window's handle to $aWinHwds Array WinMove($aWinHwds[$i], "", Mod($i, $iNumOfCols) * $iWinWidth, Int($i / $iNumOfCols) * $iWinHeight, $iWinWidth + 13, $iWinHeight + 10) Next While 1 For $i = 0 To UBound($aWinHwds) - 1 If WinExists($aWinHwds[$i], "") = 0 Then ; Check if any windows have been deleted. _ArrayDelete($aWinHwds, $i) ; This re-dimensions the $aWinHwds array. ExitLoop ; Exits For-Next loop. Will re-order windows in next For-Next loop with new UBound($aWinHwds) value. Else WinMove($aWinHwds[$i], "", Mod($i, $iNumOfCols) * $iWinWidth, Int($i / $iNumOfCols) * $iWinHeight, $iWinWidth + 13, $iWinHeight + 10) EndIf Next If UBound($aWinHwds) = 0 Then ExitLoop ; Exit script if all generated windows have been deleted. Exits While-Wend loop. Sleep(50) WEnd Func _Terminate() ; Close all created windows For $i = UBound($aWinHwds) - 1 To 0 Step -1 WinClose($aWinHwds[$i], "") Next Exit EndFunc ;==>_Terminate Another method is right click on the bottom task bar near the right hand side of the desktop and a context menu will pop up. To re-arrange the windows on the desktop select either:- Cascade windows, Show windows stacked, Show windows side by side, or, Show the desktop, from the menu. And another shell object method. ; https://msdn.microsoft.com/en-us/library/windows/desktop/bb774094(v=vs.85).aspx $objShell = ObjCreate("Shell.Application") $objShell.ToggleDesktop ; Show desktop Sleep(2000) $objShell.ToggleDesktop ; Re-instste previous desktop MsgBox(0, "ToggleDesktop 2nd time", "", 2) $objShell.TileHorizontally MsgBox(0, "TileHorizontally", "", 2) $objShell.TileVertically MsgBox(0, "TileVertically", "", 2) $objShell.CascadeWindows MsgBox(0, "CascadeWindows", "", 2) MsgBox(0, "The End", "Sorry about messing up all your windows", 2)1 point
-
You must have the ActiveDirectory module available for import (usually done by installing RSAT). In reply to a question posed on the AD UDF thread. How to dump an array of users from AD with a partial Last Name: #include <AutoItConstants.au3> #include <Array.au3> $sName = inputbox("Get AD User Info" , "AD Lastname (or partial)") $sName = "*" & $sName & "*" $sCommands = "powershell -Command import-module ActiveDirectory; Get-ADUser -LDAPfilter '(name=" & $sName & ")'" $iPID = Run(@ComSpec & " /c " & $sCommands, "", @SW_SHOW , $stdout_child) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aOut = stringsplit($sOutput, @LF , 2) for $i = ubound($aOut) - 1 to 0 step -1 $aOut[$i] = StringStripWS($aOut[$i] , 8) If stringinstr($aOut[$i] , "GivenName") And Stringright($aOut[$i] , 1) <> ":" Then $aOut[$i] = stringtrimleft($aOut[$i] , 10) ElseIf stringinstr($aOut[$i] , "Surname") And Stringright($aOut[$i] , 1) <> ":" Then $aOut[$i] = stringtrimleft($aOut[$i] , 8) Else _ArrayDelete($aOut , $i) EndIf next ;~ _ArrayDisplay($aOut) Local $aFullName[0] For $i = 0 to ubound($aOut) - 1 step 2 _ArrayAdd ($aFullName , $aOut[$i] & " " & $aOut[$i + 1]) Next $aFullNameUnique = _ArrayUnique($aFullName, 0 ,0 ,0 ,0) _ArrayDisplay($aFullNameUnique)1 point
-
I posted a solution as the ones previously posted didn't work with Opt("MouseCoordMode",2) And for the sake of anyone who is using the Forums search functions for answers before re-posting questions, I thought it may be appropriate there was a working solution in this thread. I apologise if this is offensive. wakido1 point