Leaderboard
Popular Content
Showing content with the highest reputation on 12/07/2015 in all areas
-
Incremental search in owner and custom drawn ListViews
pixelsearch and one other reacted to LarsJ for a topic
Incremental search is usually implemented by drawing the background of the substrings that matches the search string with a specific color eg. yellow. Incremental in this context means that the search is performed dynamically after each character while the search string is typed. In a listview this can be implemented by owner drawing through the LVS_OWNERDRAWFIXED flag and WM_DRAWITEM messages. (A custom drawn listview supports coloring of fields. However, the coloring works best for whole fields. This doesn't make it applicable to incremental search.) Inspiration for the example is found in these two questions: Search box for names and Search In ListView (Redraw with matching string). Examples The zip file below contains three examples. Listview items are strings of random characters with different lengths. In all examples a global $iItems = 1000 in top of script specifies the number of rows. There are no performance issues up till 10,000 rows. Note that the search is performed in an array and not directly in the listview. A regular expression can be entered in the search box. Search strings like "m........." with a varying number of dots will result in a varying number of matches. To keep it simple only one occurrence of the search string in each item is tested. As soon as one occurrence is found the search loop moves on to next item. 1) Incremental text search.au3 The first example is a simple demonstration of basic functionality: F3 and Shift+F3 can be used instead of Next and Prev buttons. 2) Show matching rows only.au3 An owner drawn listview can easily be combined with a virtual listview to extend the functionality of the incremental search. A virtual listview is especially interesting if you want to dynamically update the listview to only display the rows that matches the search string. Such an update is very fast in a virtual listview. This example is useful if the listview contains a set of file names and you are searching for a specific file eg. to open the file. In this situation you are probably not interested in the files that doesn't match. Because the listview only contains matching rows "Next match" and "Prev match" buttons are disabled. Clear the search field to display all items. 3) Standard search dialog.au3 The last example is a demonstration of a standard search dialog as the search box in Notepad. FindText function in comdlg32.dll creates the standard search box. The function is implemented as _WinAPI_FindTextDlg in WinAPIDlg.au3. In the Microsoft documentation you can read: Note that the FINDREPLACE structure and the buffer for the search string should be a global or static variable so it does not go out of scope before the dialog box closes. Because the FINDREPLACE structure is created as a local variable in _WinAPI_FindTextDlg it goes out of scope as soon as the function returns. This implementation of FindText is used in the example: ;Func _WinAPI_FindTextDlg($hOwner, $sFindWhat = '', $iFlags = 0, $pFindProc = 0, $lParam = 0) Func _WinAPI_FindTextDlgEx(ByRef $tFR, $hOwner, $sFindWhat = '', $iFlags = 0, $pFindProc = 0, $lParam = 0) $__g_pFRBuffer = __HeapReAlloc($__g_pFRBuffer, 2 * $__g_iFRBufferSize) If @error Then Return SetError(@error + 20, @extended, 0) DllStructSetData(DllStructCreate('wchar[' & $__g_iFRBufferSize & ']', $__g_pFRBuffer), 1, StringLeft($sFindWhat, $__g_iFRBufferSize - 1)) ;Local $tFR = DllStructCreate($tagFINDREPLACE) $tFR = DllStructCreate($tagFINDREPLACE) DllStructSetData($tFR, 'Size', DllStructGetSize($tFR)) DllStructSetData($tFR, 'hOwner', $hOwner) DllStructSetData($tFR, 'hInstance', 0) DllStructSetData($tFR, 'Flags', $iFlags) DllStructSetData($tFR, 'FindWhat', $__g_pFRBuffer) DllStructSetData($tFR, 'ReplaceWith', 0) DllStructSetData($tFR, 'FindWhatLen', $__g_iFRBufferSize * 2) DllStructSetData($tFR, 'ReplaceWithLen', 0) DllStructSetData($tFR, 'lParam', $lParam) DllStructSetData($tFR, 'Hook', $pFindProc) DllStructSetData($tFR, 'TemplateName', 0) Local $Ret = DllCall('comdlg32.dll', 'hwnd', 'FindTextW', 'struct*', $tFR) If @error Or Not $Ret[0] Then Local $Error = @error + 30 __HeapFree($__g_pFRBuffer) If IsArray($Ret) Then Return SetError(10, _WinAPI_CommDlgExtendedErrorEx(), 0) Else Return SetError($Error, @extended, 0) EndIf EndIf Return $Ret[0] EndFunc Then it's ensured that the local variable that is used for $tFR in the script, does not go out of scope, while the search box is open. ListviewIncrSearch.7z 1) Incremental text search.au3 2) Show matching rows only.au3 3) Standard Find text dialog.au3 DrawItem.au3 GuiListViewEx.au3 WinAPIDlgEx.au3 You need AutoIt 3.3.14 or later. Tested on Windows 7 32/64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. (Set tab width = 2 in SciTE to line up comments by column.) ListviewIncrSearch.7z2 points -
I'm a little late, but if it can help someone ... #Include <GDIPlus.au3> Global $hGui, $hGraphic, $hBrush, $aPoints $hGui = GUICreate ( 'Draw Heart Example', 500, 500 ) GUISetState() _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND ( $hGui ) $hBrush = _GDIPlus_BrushCreateSolid ( 0xFFFF0000 ) $aPoints = _HeartGetPoints ( 40, 40, 420, 420, 80 ) _GDIPlus_GraphicsFillPolygon ( $hGraphic, $aPoints, $hBrush ) While 1 Switch GUIGetMsg() Case -3 ; $GUI_EVENT_CLOSE _GDIPlus_BrushDispose ( $hBrush ) _GDIPlus_GraphicsDispose ( $hGraphic ) _GDIPlus_Shutdown() GUIDelete ( $hGui ) Exit EndSwitch Sleep ( 30 ) WEnd Func _HeartGetPoints ( $x=0, $y=0, $iWidth=100, $iHeight=100, $iPointCount=80 ) If $iPointCount < 25 Then $iPointCount = 25 Local $aPoints[$iPointCount+1][2], $k, $MaxX, $MinX, $MaxY, $MinY Local Const $fPI = ACos ( -1 ) For $i = 0 To 2*$fPi Step ( 8/$iPointCount)*$fPi/4 $k+=1 If $k > UBound ( $aPoints ) -1 Then ExitLoop $aPoints[$k][0] = 16*Sin($i)^3 $aPoints[$k][1] = 13*Cos($i)-5*Cos(2*$i)-2*Cos(3*$i)-Cos(4*$i) If $aPoints[$k][0] > $MaxX Then $MaxX = $aPoints[$k][0] If $aPoints[$k][1] > $MaxY Then $MaxY = $aPoints[$k][1] If $aPoints[$k][0] < $MinX Then $MinX = $aPoints[$k][0] If $aPoints[$k][1] < $MinY Then $MinY = $aPoints[$k][1] Next Local $w = Abs ( $MaxX ) + Abs ( $MinX ) Local $h = Abs ( $MaxY ) + Abs ( $MinY ) ; resize ( original ratio w/h : 0.965 ) For $i = 1 To UBound ( $aPoints ) -1 $aPoints[$i][0] = $x + ( $MaxX -$aPoints[$i][0] )*$iWidth/$w $aPoints[$i][1] = $y + ( $MaxY -$aPoints[$i][1] )*$iHeight/$h Next $aPoints[0][0] = UBound ( $aPoints ) -1 Return $aPoints EndFunc ;==> _HeartGetPoints()2 points
-
Hi All I know most of people want the recorder, as i search on the forum, all recorder is click by position and this one is click by window and control item, also it can detect IE and generate autoit script to fill ie form. Most of source code is copied from internet and it is not written by me. It help me a lot on my job and for Web development and QA task when it run, it will generate the au3 file and that is what you did. Please note that it cannot generate 100% autoit script for you but i think it help you wrote around 70% of automation coding, and the rest please do it on your own recorder.zip Some special key / function Esc - Stop Recording Pause / Break - Pause recording F2 - initial / insert Sleep function Scroll Lock - Control Click Mode / Position Mouse Click Mode1 point
-
That's true. It only works for standard "#32768" class menus. The context menus in eg. Chrome and Firefox with class names something like "Chrome_WidgetWin_2" and "MozillaDropShadowWindowClass" are not standard menus and the code doesn't work. These menus can be handled by UI Automation code. The example in the zip is an UI Automation event handler which looks for menu open events. It looks for popup menus, main menus and submenus. The zip contains Example.au3, CUIAutomation2.au3 by junkew and ObjectFromTag.au3 by trancexx. Run Example.au3 in SciTE. It prints information in console. The script keeps running until you stop it. Now you can try to test some of your menus. It would be interesting to hear the results. Menus.7z1 point
-
use parenthesis like this: ConsoleWrite(("Something" = "Samething") & @CRLF) ; False ConsoleWrite(Not("Something" = "Samething") & @CRLF) ; True <--- use parenthesis ConsoleWrite((Not False) & @CRLF) ; True1 point
-
I admit that it's nicer than this one : #include <GUIConstantsEx.au3> $hGui = GUICreate ( 'Draw Heart Example', 500, 500 ) GuiSetFont(500, 400, 0, "Arial Unicode MS") GUICtrlCreateLabel(ChrW(9829), 0, -230, 500, 730) GUICtrlSetColor (-1, 0xff0000) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd1 point
-
Use the WhatKeyIsPressed UDF to get the hex code of those keys and post them here. WhatKeyIsPressed UDF can be found at http://h--e.de/autoit/UDF/WhatKeyIsPressed.html1 point
-
Every keyboard has different layout of Special Keys... That is all I know, Sorry1 point
-
1 point
-
Appears to do what it says on the tin. ;#RequireAdmin #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <Array.au3> $scite = WinGetHandle("[ACTIVE]") $gui = GUICreate("gui", 1000, 500) GUISetBkColor(0x112233) GUISetState() WinActivate($scite) Sleep(500) $hwnd = WinGetHandle("gui") MsgBox(0, 0, GetColor(100, 100, $hwnd)) Func GetColor($iX, $iY, $WinHandle) Local $aPos = WinGetPos($WinHandle) $iWidth = $aPos[2] $iHeight = $aPos[3] _GDIPlus_Startup() Local $hDDC = _WinAPI_GetDC($WinHandle) Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iWidth, $iHeight) _WinAPI_SelectObject($hCDC, $hBMP) DllCall("User32.dll", "int", "PrintWindow", "hwnd", $WinHandle, "hwnd", $hCDC, "int", 0) _WinAPI_BitBlt($hCDC, 0, 0, $iWidth, $iHeight, $hDDC, 0, 0, $__SCREENCAPTURECONSTANT_SRCCOPY) $BMP = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) Local $aPixelColor = _GDIPlus_BitmapGetPixel($BMP, $iX, $iY) _WinAPI_ReleaseDC($WinHandle, $hDDC) _WinAPI_DeleteDC($hCDC) _WinAPI_DeleteObject($hBMP) _GDIPlus_ImageDispose($BMP) Return Hex($aPixelColor, 6) EndFunc ;==>GetColor Note: altered func params and does not require admin.1 point
-
@Cybernetic, I agree that my example does the same thing as yours, however the constants used (and the clear way I wrote it) make it very clear on how to solve the problem and change DBLCLCK to RDBLCLCK. Magic numbers only troubles you that's why you did not understood how it works. It's a pity you asked for the answer and someone cared to give you the solution (no offense to both), but you can't learn by this way. Br, FireFox.1 point
-
I use this template in my projects: #include <GuiConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #region GLOBAL VARIABLES Global $iW = 600, $iH = 400, $iT = 52, $iB = 52, $iLeftWidth = 150, $iGap = 10, $hMainGUI #endregion GLOBAL VARIABLES _MainGui() Func _MainGui() Local $hFooter, $nMsg, $aPos Local $iLinks = 5 Local $sMainGuiTitle = "Sample Title" Local $sHeader = "Sample GUI" Local $sFooter = "2012 © AutoIt" Local $aLink[$iLinks], $aPanel[$iLinks] $aLink[0] = $iLinks - 1 $aPanel[0] = $iLinks - 1 $hMainGUI = GUICreate($sMainGuiTitle, $iW, $iH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP)) GUISetIcon("shell32.dll", -58, $hMainGUI) GUICtrlCreateLabel($sHeader, 48, 8, $iW - 56, 32, $SS_CENTERIMAGE) GUICtrlSetFont(-1, 14, 800, 0, "Arial", 5) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) GUICtrlCreateIcon("shell32.dll", -131, 8, 8, 32, 32) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) GUICtrlCreateLabel("", 0, $iT, $iW, 2, $SS_SUNKEN);separator GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT) GUICtrlCreateLabel("", $iLeftWidth, $iT + 2, 2, $iH - $iT - $iB - 2, $SS_SUNKEN);separator GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH) GUICtrlCreateLabel("", 0, $iH - $iB, $iW, 2, $SS_SUNKEN);separator GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKHEIGHT) $hFooter = GUICtrlCreateLabel($sFooter, 10, $iH - 34, $iW - 20, 17, BitOR($SS_LEFT, $SS_CENTERIMAGE)) GUICtrlSetTip(-1, "AutoIt Forum", "Click to open...") GUICtrlSetCursor(-1, 0) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT) ;add links to the left side $aLink[1] = _AddNewLink("Link 1") $aLink[2] = _AddNewLink("Link 2", -167) $aLink[3] = _AddNewLink("Link 3", -222) $aLink[4] = _AddNewLink("Link 4", -22) ;and the corresponding GUI's $aPanel[1] = _AddNewPanel("Title for the panel 1") $aPanel[2] = _AddNewPanel("Title for the panel 2") $aPanel[3] = _AddNewPanel("Title for the panel 3") $aPanel[4] = _AddNewPanel("Title for the panel 4") ;add some controls to the panels _AddControlsToPanel($aPanel[1]) GUICtrlCreateEdit("", 10, 37, $iW - $iLeftWidth + 2 - 20 - 5, $iH - $iT - $iB - 40, BitOR($ES_AUTOVSCROLL, $ES_NOHIDESEL, $ES_WANTRETURN, $WS_VSCROLL), $WS_EX_STATICEDGE) Local $sTestTxt = "" For $i = 1 To 10 $sTestTxt &= @TAB & "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum felis lectus, pharetra vel laoreet nec, pulvinar nec justo. Donec malesuada, nunc eu faucibus sodales, diam sem tempor neque, id condimentum turpis nunc vel lacus. Nulla a nulla libero, eget eleifend dolor. Vivamus volutpat tincidunt ultricies. Vestibulum eu libero nisi, quis tincidunt nisi. Proin tincidunt, ipsum ullamcorper posuere venenatis, libero nulla venenatis enim, ultrices tincidunt ipsum arcu nec turpis. In at erat sed ipsum gravida mattis in at felis. Vivamus diam purus, dictum ut luctus vitae, sollicitudin ut velit. Maecenas velit mauris, fringilla ut condimentum bibendum, aliquam a neque. Nulla metus eros, commodo id dictum in, interdum sed ipsum. Vivamus feugiat, mi at auctor fringilla, libero lectus vulputate tortor, eu sollicitudin nulla lacus at neque." & @CRLF $sTestTxt &= @TAB & "Sed vel ante magna. Curabitur porttitor ante in tellus bibendum non tristique diam volutpat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In tellus lectus, ultrices in tempus eget, sollicitudin quis eros. Curabitur at arcu bibendum massa feugiat euismod at a felis. Nunc molestie, enim non ornare tincidunt, ipsum nisi tempus sapien, quis elementum elit velit ut neque. Suspendisse eu adipiscing risus. Nam tempor odio ut elit auctor rhoncus. Etiam viverra elit id felis feugiat pellentesque pretium porttitor dui. Vivamus eu quam non ante suscipit vehicula a nec eros. Phasellus congue massa sed libero interdum ullamcorper. Quisque fringilla massa ut lorem fringilla pulvinar eget ullamcorper eros. Praesent faucibus, erat at consequat tempus, nulla erat sodales mi, eget sagittis nibh erat nec nunc. Phasellus risus nibh, porta viverra pretium nec, vehicula eget nisi." & @CRLF $sTestTxt &= @TAB & "Sed vel neque vel urna elementum accumsan feugiat quis mauris. Sed mi nisl, consequat dapibus molestie ac, rutrum ut elit. Praesent sed risus sem. Mauris rutrum blandit magna nec tristique. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse consequat iaculis odio nec cursus. Duis varius tincidunt ligula ac ultricies. Ut eget magna in nulla vulputate dapibus ut vel sem. Integer ac tempor risus." & @CRLF $sTestTxt &= @TAB & "Maecenas molestie semper turpis, id tristique nibh pharetra eget. Aliquam erat volutpat. In egestas, lorem quis varius vestibulum, enim diam porta lorem, quis dictum arcu ante a diam. Nullam vel nisi mauris. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam ut leo purus, eget vulputate augue. Fusce et est sagittis felis accumsan sollicitudin eget a lectus. Cras sapien sapien, rutrum eu tempor non, tempor nec velit. Vivamus interdum adipiscing felis in malesuada. Fusce quis purus est, eget molestie turpis. In hac habitasse platea dictumst." & @CRLF $sTestTxt &= @TAB & "Aenean eleifend risus vitae lorem laoreet facilisis. Suspendisse ac urna quam, vel rutrum sem. Sed bibendum porta tellus malesuada scelerisque. Vestibulum at ligula sed nulla sollicitudin tincidunt. Pellentesque mi magna, vulputate et aliquam a, auctor et nunc. Phasellus feugiat fringilla accumsan. Donec ultrices, elit id dapibus auctor, nunc odio viverra lorem, non commodo mi libero a libero. Cras vitae felis venenatis augue laoreet tincidunt scelerisque id odio. Proin lorem purus, molestie feugiat pretium nec, ornare aliquam turpis. " Next GUICtrlSetData(-1, $sTestTxt) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) _AddControlsToPanel($aPanel[2]) GUICtrlCreateLabel("Label1", 8, 38, 36, 17) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Local $hInput1 = GUICtrlCreateInput("Input1", 56, 35, 121, 21) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Local $hButton1 = GUICtrlCreateButton("Button1", 200, 33, 75, 25) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) _AddControlsToPanel($aPanel[3]) GUICtrlCreateList("", 8, 37, 121, 93, -1, 0) GUICtrlSetData(-1, "dfgdfg|ertert|kljlkj|poipoi|qweqwe") GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) _AddControlsToPanel($aPanel[4]) GUICtrlCreateGroup("Group1", 8, 35, 129, 90) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Local $aChkBox[4] For $i = 1 To 3 $aChkBox[$i] = GUICtrlCreateRadio("Some radio " & $i, 16, 56 + ($i - 1) * 20, 113, 17) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Next GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlCreateGroup("", -99, -99, 1, 1) ;set default to Panel1 GUISwitch($aPanel[1]) ;show the main GUI GUISetState(@SW_SHOW, $hMainGUI) While 1 Sleep(10) $nMsg = GUIGetMsg(1) Switch $nMsg[1] Case $hMainGUI Switch $nMsg[0] Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE, $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE $aPos = WinGetPos($hMainGUI) $iW = $aPos[2] $iH = $aPos[3] For $i = 0 To $aPanel[0] WinMove($aPanel[$i], "", $iLeftWidth + 2, $iT, $iW - $iLeftWidth + 2, $iH - $iT - $iB - 20) Next Case $aLink[1], $aLink[2], $aLink[3], $aLink[4] For $i = 1 To $aLink[0] If $nMsg[0] = $aLink[$i] Then GUISetState(@SW_SHOW, $aPanel[$i]) Else GUISetState(@SW_HIDE, $aPanel[$i]) EndIf Next Case $hFooter ShellExecute("http://www.autoitscript.com/forum/topic/146952-gui-design-concepts/") EndSwitch Case $aPanel[2] Switch $nMsg[0] Case $hButton1 MsgBox(32, "Test", "You have " & GUICtrlRead($hInput1) & "?") EndSwitch Case $aPanel[4] Switch $nMsg[0] Case $aChkBox[1], $aChkBox[2], $aChkBox[3] For $i = 1 To 3 If GUICtrlRead($aChkBox[$i]) = $GUI_CHECKED Then MsgBox(64, "Test", "You checked nr. " & $i & "!") Next EndSwitch EndSwitch WEnd EndFunc ;==>_MainGui Func _AddNewLink($sTxt, $iIcon = -44) Local $hLink = GUICtrlCreateLabel($sTxt, 36, $iT + $iGap, $iLeftWidth - 46, 17) GUICtrlSetCursor(-1, 0) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) GUICtrlCreateIcon("shell32.dll", $iIcon, 10, $iT + $iGap, 16, 16) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) $iGap += 22 Return $hLink EndFunc ;==>_AddNewLink Func _AddNewPanel($sTxt) Local $gui = GUICreate("", $iW - $iLeftWidth + 2, $iH - $iT - $iB, $iLeftWidth + 2, $iT, $WS_CHILD + $WS_VISIBLE, -1, $hMainGUI) GUICtrlCreateLabel($sTxt, 10, 10, $iW - $iLeftWidth - 20, 17, $SS_CENTERIMAGE) GUICtrlSetFont(-1, 9, 800, 4, "Arial", 5) GUICtrlSetResizing(-1, $GUI_DOCKTOP + $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Return $gui EndFunc ;==>_AddNewPanel Func _AddControlsToPanel($hPanel) GUISwitch($hPanel) EndFunc ;==>_AddControlsToPanel1 point