Jump to content

Search the Community

Showing results for tags 'guicreate'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 13 results

  1. I don't often have occasion to use Child GUIs. I find the multitude of options confusing. The example below I made for my own purposes, to have a visual guide to what the various Style and Extended Style options lead to. Comments are much appreciated. This can be extended with many more examples and comments and why certain Styles are to preferred or avoided. Where certain types of Child GUIs are most suitable etc. The code is very basic. It is intended to show GUI Styles, not much else. ;~ ******************************************************************** ;~ Author: Skysnake ;~ ;~ Title: Demo various Child Gui options ;~ Updated: 2019.01.03 ;~ ;~ Function: A demo script, demonstrates various style & Extended ;~ style options for Child GUIs ;~ Comments, ideas and suggestions very welcome :) ;~ ;~ ******************************************************************** #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <Constants.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> #include <MsgBoxConstants.au3> ShowChildGuis() Func ShowChildGuis() Local $guiParent = GUICreate("The Parent GUI", 1200, 700, 0, 0) ;WHLT $idFilemenu = GUICtrlCreateMenu(" &Menu") $ButtonCancel = GUICtrlCreateButton("&Close", 0, 0, 80, 25) GUICtrlSetTip($ButtonCancel, "Click to close all") $ButtonShowChildGui = GUICtrlCreateButton("&Show", 0, 25, 80, 25) GUICtrlSetTip($ButtonShowChildGui, "Click to show a child GUI") ;~ #comments-start --- Toggle this and same code below to show context menu for parent or child Local $idContextmenu = GUICtrlCreateContextMenu() Local $idNewsubmenu = GUICtrlCreateMenu("This is a Context Menu", $idContextmenu) Local $idNewsubmenuText = GUICtrlCreateMenuItem("text", $idNewsubmenu) Local $idContextButton = GUICtrlCreateButton("Context", 0, 50, 80, 25) GUICtrlSetTip($idContextButton, "Right Click to see Context Menu") Local $idButtoncontext = GUICtrlCreateContextMenu($idContextButton) Local $idMenuAbout = GUICtrlCreateMenuItem("This is a Context Menu", $idButtoncontext) Local $idMenuOpen = GUICtrlCreateMenuItem("Open", $idContextmenu) Local $idMenuSave = GUICtrlCreateMenuItem("Save", $idContextmenu) GUICtrlCreateMenuItem("", $idContextmenu) ; separator Local $idMenuInfo = GUICtrlCreateMenuItem("Info", $idContextmenu) ;~ #comments-end --- Toggle this and same code below to show context menu for parent or child Local $DefaultChildGui = GUICreate("Default child gui", 300, 100, 300, 300, Default, Default, $guiParent) ;;;WHLT GUICtrlCreateLabel("Default attributes" & @CRLF & "Cannot move; cannot resize", 0, 0, 500, 200) GUICtrlSetBkColor(-1, $COLOR_aqua) $iStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($DefaultChildGui), $GWL_STYLE) $iExStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($DefaultChildGui), $GWL_EXSTYLE) GUISetStyle(BitOR($iStyle, $WS_VISIBLE), $iExStyle, $DefaultChildGui) Local $gChildGuiwithMenu = GUICreate("A child gui with menu", 300, 100, 50, 100, $WS_VISIBLE, BitOR($WS_EX_WINDOWEDGE, $WS_EX_MDICHILD, $WS_THICKFRAME), $guiParent) ;;;WHLT GUICtrlCreateLabel("Menu" & @CRLF & "Can move; cannot resize", 0, 0, 500, 200) GUICtrlSetBkColor(-1, $COLOR_skyblue) $idFilemenu = GUICtrlCreateMenu(" &File ") Local $idFileMenuItem = GUICtrlCreateMenuItem("An item for the File menu ", $idFilemenu) GUICtrlCreateMenuItem("", $idFilemenu) ; create a separator line ; use same dimensions for GUI and its Label Local $iSizeWide = 300, $iSizeHi = 100 GUICreate("A child gui", $iSizeWide, $iSizeHi, 100, 200, $WS_VISIBLE, BitOR($WS_EX_WINDOWEDGE, $WS_EX_TOPMOST, $WS_EX_MDICHILD, $WS_THICKFRAME), $guiParent) ;;;WHLT GUICtrlCreateLabel("Can move; cannot resize" & @CRLF & "Always on top", 0, 0, $iSizeWide, $iSizeHi) GUICtrlSetBkColor(-1, $COLOR_red) GUICreate("Child Gui Resizable", 300, 100, 200, 50, BitOR($WS_POPUP, $WS_SIZEBOX, $WS_CLIPCHILDREN, $WS_VISIBLE), $WS_EX_MDICHILD, $guiParent) ;;;WHLT GUICtrlCreateLabel("Popup Cannot move; can resize" & @CRLF & "Background", 0, 0, 500, 200) ; $WS_CHILD, GUICtrlSetBkColor(-1, $COLOR_blue) ; toggle the line below :) ;$idBackgroundmenu = GUICtrlCreateMenu(" &Menu ") ; give it a menu GUICreate("Child GUI, caption, resize", 300, 100, 300, 100, BitOR($WS_VISIBLE, $WS_POPUP, $WS_CAPTION), BitOR($WS_EX_TOOLWINDOW, $WS_EX_MDICHILD, $WS_EX_ACCEPTFILES), $guiParent) GUICtrlCreateLabel("Popup With Caption: Can move; cannot resize", 0, 0, 500, 200) GUICtrlSetBkColor(-1, $COLOR_yellow) GUICreate("Child GUI, abc", 300, 100, 400, 150, BitOR($WS_POPUP, $WS_VISIBLE, 0), $WS_EX_MDICHILD, $guiParent) GUICtrlCreateLabel("Popup Cannot move; cannot resize", 0, 0, 500, 200) GUICtrlSetBkColor(-1, $COLOR_green) ; Child GUI below has a control ............................. ............................................. Local $gChildWithControls = GUICreate("Child GUI with Buttons", 400, 400, 500, 200, BitOR($WS_CAPTION, $WS_CHILD), -1, $guiParent) GUISetFont(14, $gChildWithControls) Local $cLabel = GUICtrlCreateLabel("Can move; cannot resize", 0, 0, 400, 50) GUICtrlSetBkColor($cLabel, $COLOR_white) Local $idChild_ButtonOkay = GUICtrlCreateButton("Okay", 0, 50, 80, 30) Local $idChild_ButtonHide = GUICtrlCreateButton("Hide", 0, 80, 80, 30) GUICtrlSetTip($idChild_ButtonHide, "Click to hide this child GUI") ;~ #comments-start --- Toggle this and same code below to show context menu for parent or child ;~ Local $idContextmenu = GUICtrlCreateContextMenu() ;~ Local $idNewsubmenu = GUICtrlCreateMenu("This is a Context Menu", $idContextmenu) ;~ Local $idNewsubmenuText = GUICtrlCreateMenuItem("text", $idNewsubmenu) ;~ Local $idContextButton = GUICtrlCreateButton("Context", 0, 110, 80, 30) ;~ GUICtrlSetTip($idContextButton, "Right Click to see Context Menu") ;~ Local $idButtoncontext = GUICtrlCreateContextMenu($idContextButton) ;~ Local $idMenuAbout = GUICtrlCreateMenuItem("This is a Context Menu", $idButtoncontext) ;~ Local $idMenuOpen = GUICtrlCreateMenuItem("Open", $idContextmenu) ;~ Local $idMenuSave = GUICtrlCreateMenuItem("Save", $idContextmenu) ;~ GUICtrlCreateMenuItem("", $idContextmenu) ; separator ;~ Local $idMenuInfo = GUICtrlCreateMenuItem("Info", $idContextmenu) ;~ #comments-end --- Toggle this and same code below to show context menu for parent or child GUISetState(@SW_HIDE, $gChildWithControls) ;.......................................................................................................... Local $gToolbar = GUICreate("A floating Tool Window", 300, 50, 100, 25, $WS_VISIBLE, $WS_EX_TOOLWINDOW, $guiParent) GUICtrlCreateLabel("A floating toolbar", 0, 0, 500, 200) ; this does not show :) GUICtrlSetBkColor(-1, $COLOR_lime) ;~ $iStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($gToolbar), $GWL_STYLE) ;~ $iExStyle = _WinAPI_GetWindowLong(GUICtrlGetHandle($gToolbar), $GWL_EXSTYLE) ; BitOR($WS_EX_TOOLWINDOW, $WS_EX_MDICHILD) ;~ GUISetStyle(BitOR($iStyle, $WS_VISIBLE), $iExStyle, $gToolbar) $idToolmenu = GUICtrlCreateMenu(" &Tool ") Local $idToolMenuItem = GUICtrlCreateMenuItem("An item for the Tool menu ", $idToolmenu) Local $idToolMenuItemsecond = GUICtrlCreateMenuItem("A second item for the Tool menu ", $idToolmenu) GUICtrlCreateMenuItem("", $idToolmenu) ; create a separator line $idPrintmenu = GUICtrlCreateMenu(" &Print ") Local $idToolMenuItemPrint = GUICtrlCreateMenuItem("A Print item for the Toolbar print menu ", $idPrintmenu) GUICtrlCreateMenuItem("", $idPrintmenu) ; create a separator line #Region --- After GUI BEFORE loop starts GUISetState(@SW_SHOW, $guiParent) #EndRegion --- After GUI BEFORE loop starts While 1 ;Local $nMsg = GUIGetMsg() Switch GUIGetMsg() ; $nMsg Case $GUI_EVENT_CLOSE, $ButtonCancel GUIDelete($guiParent) ExitLoop Case $idContextButton MsgBox($MB_SYSTEMMODAL, "Button Clicked", 'Right Click to see the Contect Menu') Case $ButtonShowChildGui GUISetState(@SW_ENABLE, $gChildWithControls) GUISetState(@SW_SHOW, $gChildWithControls) Case $idChild_ButtonHide ; <<<<<<<<<<<<<<< Child Gui Control Actioned in main loop ConsoleWrite("Yup, you clicked it" & @CRLF) GUISetState(@SW_HIDE, $gChildWithControls) Case $idChild_ButtonOkay ; <<<<<<<<<<<<<<< Child Gui Control Actioned in main loop ConsoleWrite("Yup, you clicked it" & @CRLF) MsgBox($MB_SYSTEMMODAL, "Button Clicked", 'Okay') EndSwitch WEnd GUIDelete() EndFunc ;==>ShowChildGuis
  2. I have the impression that the traditional method for processing responses to a GUI is to assign variables to each GUICreateButton (or Pic) and then use Switch/Case/Endswitch to detect when any Control is clicked. In the tutorials I've seen about Koda it appears to use this method, too. While 1 Global $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Pic2 Call("verizon") Case $Pic3 Call("skype") Case $PicExit Exit EndSwitch WEnd But in a few examples I've seen a script use a different method. The script always includes the following option near the top: Opt("GUIOnEventMode", 1) ...and then, later, after creating each Control for the GUI, there's the function, GUICtrlSetOnEvent. In these cases a very simple While/WEnd loop is used to wait for the user to respond. I happened to employ this second method in a recent script where I used "canned" controls (checkbox and buttons). Later in the same script I used the GuiCreatePic and Switch/Case/EndSwitch method because my GUI was all custom images. (I'm not sure if that's necessary, but it's what I've deduced.) The second GUI failed to respond to any mouse clicks, but eventually I figured out the cause was the GUIOnEvenMode being enabled at the top of the script. This is when I realized I don't understand the reasoning behind choosing between these two methods. And I'm having no luck phrasing an appropriate search criterion. Is there an overview somewhere that explains the two methods and -- most importantly -- describes when each is appropriate?
  3. Hi there I am building a "statistics kiosk" where we will be enumerating through Web Pages, and Excel files, PDF reports and other applications each displaying statistics relevant to our project. I want to overlay some context over each page/screen so that viewers of this "statistics kiosk" have some info about that the data they are looking at is. I have written a function called OverlayWindow which is supposed to create a transparent window which displays some text. The function SEEMS to work BUT The handle returned from CreateGUI is 0 (despite there being NO error or extended information) The window is created but not maintained. In other words it appears but since it is not really maintained it is repainted as other content changes. The result is that the overlay appears BUT as soon as there is a reason for the underlying windows to repaint the overlay starts to "disappear" I have extracted the relevant code and created the most simplistic of samples here. #include <FileConstants.au3> #include <WinAPIFiles.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISysWin.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode ; #FUNCTION# ==================================================================================================================== ; Name ..........: OverlayWindow ; Description ...: Throws up a child window with transparent background over current window ; ; Parameters : ; $hwndParent parent hwnd ; $rectToHighlight rect to draw (or if null, skip) ; $rectForText rect for textToWrite ; $textToWrite the text to write ; =============================================================================================================================== Func OverlayWindow($hwndParent, $rectToHighlight, $rectForText, $textToWrite) $style = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS) $exstyle = BitOR($WS_EX_TOPMOST, $WS_EX_COMPOSITED, $WS_EX_TRANSPARENT) $hGUI = GUICreate("transparent overlay", -1, -1, -1, -1, $style, $exstyle) ConsoleWrite("**** $hGUI: " & $hGUI & @CRLF) ConsoleWrite("**** @error: " & @error & @CRLF) ConsoleWrite("**** @extended: " & @extended & @CRLF) GUISetOnEvent($GUI_EVENT_CLOSE, "OverlayWindow_Exit") GUISetState(@SW_SHOW, $hGUI) $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ConsoleWrite("**** $hGraphics : " & $hGraphics & @CRLF) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) $hPen = _GDIPlus_PenCreate(0xFFFF0000, 4) ; Red If ($rectToHighlight <> Null) Then _GDIPlus_GraphicsDrawRect($hGraphics, $rectToHighlight[0], $rectToHighlight[1], $rectToHighlight[2], $rectToHighlight[3], $hPen) EndIf _GDIPlus_PenDispose($hPen) $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000) ; RED $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hFont = _GDIPlus_FontCreate($hFamily, 14, 2) $tLayout = _GDIPlus_RectFCreate($rectForText[0], $rectForText[1], $rectForText[2], $rectForText[3]) $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $textToWrite, $hFont, $tLayout, $hFormat) _GDIPlus_GraphicsDrawStringEx($hGraphics, $textToWrite, $hFont, $aInfo[0], $hFormat, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_FontDispose($hFont) _GDIPlus_GraphicsDispose($hGraphics) Return $hGUI EndFunc Func OverlayWindow_Exit() ConsoleWrite("* * * Exit event called" & @CRLF) EndFunc Func Handle_Esc() $Done = True EndFunc ;----------------------------------------------------------------- ;Main() _GDIPlus_Startup() Global $Done = False Local $rect = [10, 10, 400, 400] Local $rectForText = [15, 15, 380, 380] $hGUI = OverlayWindow(Null, $rect, $rectForText, "This is a test with long text long text and should automatically wrap long text " & @CRLF & "and " & @CRLF & " handle " & @CRLF & "cariage returns and line feeds") HotKeySet ( "{Esc}", Handle_Esc) While Not $Done Sleep(100) WEnd GUIDelete($hGUI) _GDIPlus_Shutdown () Exit 0 I am assuming the since CreateGUI returns 0 that the _GDIPlus_GraphicsCreateFromHWND is simply creating a "graphics context" based on the desktop then and not on my window. And thus - there IS no window (despite no @error nor no @extended data) So I think the issue is in the "styles" of window I am using. If I don't use WS_CHILD (for example I use WS_POPUP) then I get a handle back for my window and the lifetime of the window is what i want but it is not transparent as I want. Setting styles on the window to be transparent (either using extended styles, or using WinSetTrans or _WinAPI_SetBkMode) results in my rectangle and string being transparent - not what I want either. Any suggestions? any and all help is appreciated Thanks!
  4. Hi I am developing a script that types a string that can be specified in the Inputbox that has the $In01 variable attached. But 3 things are not working: It's not loading the gui, even when Guicreate() is specified in the code It's not typing the string, and i dont know why it doesn't type it. And last of them, It's not detecting if the script has a different name than the original, My Script is below: ;Script STRNG= 103494x104955x01 #include <Misc.au3> #Include <File.au3> #include <GuiConstants.au3> #INCLUDE <GuiConstantsEx.au3> #pragma compile(inputboxres, true)" If @ScriptName Not = "DynamicRookie's Colorized No. 103494x104955x01.au3" Then MsgBox(0, "Unofficial", "You are running an unnoficial version of STRNG: 103494x104955x01 by DynamicRookie, but feel free to use it below your own risk :)") ShellExecute("https://www.autoitscript.com/forum/profile/104955-dynamicrookie/") EndIf $StringVal116 = 1 $Const_Win32_idGetHandle = WinGetHandle("103494x104955x01", "1x1") Sleep (10) Hotkeyset("{=}", "_ResetVariable") SetError(0, 0, 0) $In01 = InputBox("In01", "Please enter the string you want to automate :)") If @error = 4 Then Call("ConsoleErrorFunction") EndIf MsgBox(4, "In03", "Want to enable _HasToRenewVal Function? (DEFAULT: Yes)") If $IDYES = 6 Then $_HTRVal = True Elseif $IDNO = 7 Then $_HTRVal = False EndIf Global $StringVal104910 = 0 ;Default String 0x0x1 :) Global $StringVal116 = 0 ;Custom String 0x5x1 :) Global $State = 1 Global $vReStr = '000' MsgBox(0, "DynaRookie", "Script made by DynamicRookie, for 103494 in AutoIt Forums") GUICreate("103494x104955x01", 400, 400, -1, -1, -1, -1) GUICtrlCreateLabel("103494x104955x01 Active Process", 10, 10, 100, 20, -1, -1) GUICtrlCreateLabel("Value Extension Macrostring: ", 10, 40, 100, 20) $vReStr = GUICtrlCreateLabel("N/V/R", 112, 40, 50, 20) GUICtrlCreateLabel("String Specified: # " & $In01 & " #, type K to type specified string.", 0, 100, 300, 20) Call("_D4N4M11CCKR010K133") ;It waits until u press K to check for $In03 and if checked to type type $In01 in the chat, then you need to press "=" key to enable the variable back, else ;If HasToRenew function is enabled you dont need to enable it back, ;else if the variable is already enabled and you dont want to make it type $In01 when you press K, press "=" when ;the variable is already enabled, it will deactivate it until you press "=" again. Func Init0() GUICtrlSetData($vReStr, 'Initializing: Control 0x1') $StatusString = "Init0" Sleep(1) $i_Win32_idPosition = WinGetPos("103494x104955x01", "1x2") $i_Win32_Status = "Active0" GUICtrlSetData($vReStr, 'Ready to use!') $StatusString = "RD1" Call("_D4N4M11CCKR010K133") EndFunc Func _D4N4M11CCKR010K133() While 1 If _IsPressed('4B') And $StringVal116 = 1 Then $StringVal104910 = 1 ExecuteFunction_0_0_0_1() EndIf Sleep(100) WEnd EndFunc Func _ResetVariable() If $State = 0 And $_HTRVal = True Then $State = 1 Call ("_D4N4M11CCKR010K133") Elseif $State = 1 And $_HTRVal = True Then $State = 0 Call ("_D4N4M11CCKR010K133") Else Call("_D4N4M11CCKR010K133") EndIf Endfunc Func ExecuteFunction_0_0_0_1() If $StatusString = "Init0" Then MsgBox(0, "Wait", "Please wait until it loads completely") Call("Init0") ElseIf $State = 1 And $_HTRVal = True Then GUICtrlSetData($vReStr, "Typing specified string") Send('' & $In01 & '', 1) $State = 0 GuiCtrlSetData($vReStr, "Sent function command!") Call("_D4N4M11CCKR010K133") ElseIf $State = 0 or $State = 1 And _HTRVal = False Then GUICtrlSetData($vReStr, "Typing specified string") Send('' & $In01 & '', 1) GuiCtrlSetData($vReStr, "Sent function command!") Call("_D4N4M11CCKR010K133") Else Call("_D4N4M11CCKR010K133") EndIf EndFunc Func ConsoleErrorFunction() ConsoleWrite($Const_Win32_idGetHandle) MsgBox("1, 48, 256, 4096, 2097152", "Exception @error", "An Unexpected error has occurred, please contact DynamicRookie for help, in AutoIt forums ( This window will close in " & $i_idTimeout_msg & "seconds", $i_idTimeout_msg) Exit 0 If @error = 1 Then ConsoleWrite("User has decided: Cancel = Val. 2") Exit 0 ElseIf @error = 2 Then ShellExecute("https://www.autoitscript.com/forum/profile/104955-dynamicrookie/") ConsoleWrite("User has decided: Nothing = Val. 0") Exit 0 EndIf
  5. Hi Maybe I am just being silly, but I don't understand what is supposed to happen here. ::/html/functions/GUICreate.htm GuiCreate from the Help file has 2 examples. Specifically, the 2nd example creates a ChildGui. Or so it says. I do not see this on screen. $hGUI gets created, no problem. Local $hChild = GUICreate("ChildGui", 10, 10, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) What exactly does this line do? Should I see it on screen? Skysnake
  6. I think I am missing something obvious I want the "color bar" to stretch from side to side (entire width) of the GUI. On resize it must expand / contract as necessary. I guess the answer is easy, but I need a bit of help please? $hForm = GUICreate('myColor Picker', 300, 200,-1, -1, $WS_MAXIMIZEBOX + $WS_SYSMENU + $WS_CAPTION) ;color the GUI background ;GUISetBkColor($sColorformFile, $hForm) ; set the gui background color ;Local $mycolorLabel = GUICtrlCreateLabel("",10,10,300,10) ; a blank LABEL color bar Local $mycolorLabel = GUICtrlCreateGraphic( -1,-1,300,10) ; a blank GRAPHIC color bar GUICtrlSetResizing($mycolorLabel, $ws_sizebox);$GUI_DOCKMENUBAR);$GUI_DOCKAUTO) ;$GUI_DOCKBORDERS) GUICtrlSetBkColor($mycolorLabel,$sColorformFile) ; set the color for the label This is an extract from here, by @Yashied $hForm = GUICreate('myColor Picker', 300, 200,-1, -1, $WS_MAXIMIZEBOX + $WS_SYSMENU + $WS_CAPTION) ;color the GUI background ;GUISetBkColor($sColorformFile, $hForm) ; set the gui background color ;Local $mycolorLabel = GUICtrlCreateLabel("",10,10,300,10) ; a blank LABEL color bar Local $mycolorLabel = GUICtrlCreateGraphic( -1,-1,300,10) ; a blank GRAPHIC color bar GUICtrlSetResizing($mycolorLabel, $ws_sizebox);$GUI_DOCKMENUBAR);$GUI_DOCKAUTO) ;$GUI_DOCKBORDERS) GUICtrlSetBkColor($mycolorLabel,$sColorformFile) ; set the color for the label Specifically my issue is with that $mycolorLabel Thanks, Skysnake
  7. I am using the following code to create a Gui and a progress bar that I can minimize: Global $Home = GUICreate("Intake", 1366,768, 192, 114, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX)) ProgressOn("Processing...", "Backing up", "Please wait...", 0, 0, $DLG_MOVEABLE + $DLG_NOTONTOP) This works, but the part that I'm trying to fix is that there is a GUI where you press the button to kick off the progress and I'm wondering if there is a way to nest the progress bar into that gui so its movable, but when I minimize the GUI, the progress window also minimized (same for if its clicked... pull both the GUI and progress window up together). Right now, I get the Gui window and no Progress window on the task bar, but when I alt+Tab i can see both. This makes it so sometimes the progress bar is pushed to the background and the GUI sits on top preventing you from seeing the progress window. Any easy way of doing this?
  8. Hi all this is an Photoshop edited image but i want to create a window like that it should have an extra button for specific tasks. Can anyone give me a clue to create a GUI like that
  9. Hello guys ... I noticed that a window created with AutoIt, the coordinates of width and height are relative to the client area rather than to the window itself! Well, after some tests I got this simple code that causes the width and height are for the window and not to the client area. I hope it's useful for someone else ... Code: Func _GUICreateEx($Title, $iWidth = 400, $iHeight = 400, $iLeft = -1, $iTop = -1, $iStyle = -1, $iexStyle = -1, $hParent = 0) If $iWidth > @DesktopWidth Then $iFrameY = DllCall("user32.dll", "int", "GetSystemMetrics", "int", 33) $iFrameY = $iFrameY[0] $iWidth = @DesktopWidth - $iFrameY EndIf If $iHeight > @DesktopHeight Then $iHeight = @DesktopHeight Local $hWnd = GUICreate($Title, $iWidth, $iHeight, $iLeft, $iTop, $iStyle, $iexStyle, $hParent) WinMove($hWnd, "", Int((@DesktopWidth - $iWidth) / 2), Int((@DesktopHeight - $iHeight) / 2), $iWidth, $iHeight) Return $hWnd EndFunc ;==>_GUICreateEx The syntax, of course, is the same as the native function! So long, JS
  10. NO code, but a question...what is your method for adding a control in an already created GUI. Say you created your GUI, and then decided that there was something missing, and you wanted to put it in the middle or where ever...you have to move all the controls after it and it is a pain. Does anyone have an easy method, or the method you choose to begin with so you do not have to worry about this coming up in the future?
  11. post deleted due to no responses and subsequent findings re bmp file rendering
  12. So I have tested a bit of code that allows me to store login and password information and use it later on to login. See Code below Func LoginInfo() Local $User, $Password Local $btn, $msg Global $Usr, $Pwd GUICreate(" User Name and Password for ESQ", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1) $User = GUICtrlCreateInput("", 10, 5, 300, 20) $Password = GUICtrlCreateInput("", 10, 35, 300, 20,0x0020) $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd $Usr = GUICtrlRead($User) $Pwd = GUICtrlRead($Password) ;MsgBox(4096, "User and Password", GUICtrlRead($User)) ;MsgBox(0,"Password",GUICtrlRead($Password)) EndFunc LoginInfo() #include <IE.au3> MsgBox(4096, "User and Password", $Usr) MsgBox(0,"Password",$Pwd) $URL = "https://google.com" $IE = _IECreate($URL, 0, 0, 0) $HWND = _IEPropertyGet($IE, "hwnd") WinSetState($HWND,"",@SW_MAXIMIZE) _IEAction($IE, "visible") _IELoadWait($IE) Sleep(1000) Sleep(1000) MouseClick("Left",-685,274) Send($Usr) Sleep(1000) MouseClick("Left",-685,296) Send($Pwd) Sleep(500) Send(@CR) Once I use this working code in my larger program it fails. It won't store the login and password information, nor will it wait for rest of the program until the login information is entered. What am I doing wrong?
  13. Can GUICreate's dimentions be changed dynamically as new buttons are added in a "for" loop? Thanks!
×
×
  • Create New...