kylomas Posted November 18, 2011 Share Posted November 18, 2011 Hi, Environment - Win7 (64bit) SP1 (current maintenance levels) - AutoIT current Prod release I cannot get my gui to resize. The Gui accepts drag and drop files to an edit control, or allows browsing files/folders to poplate the edit control. The commented GUICREATE stmt's below show what I've tried. Also, When the script is run using the current guicreate stmt, my gui is not shown but a "fileselectfolder" gui is shown. IT is as if an event is being driven for one of my controls, but I don't see how. The gui does not even display. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <array.au3> local $files = '',$tt ;local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, -1, bitor($WS_SIZEBOX,$WS_EX_ACCEPTFILES)) ;local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, -1, $WS_SIZEBOX + $WS_EX_ACCEPTFILES) local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, -1, $WS_OVERLAPPEDWINDOW) guisetfont(10,800) guictrlcreatelabel('List of Files to Copy - [ Drag and Drop or ',10,52,300,50) local $bttn010 = guictrlcreatebutton('Browse for files',300,50,150,20) guictrlcreatelabel(']',460,52,10,50) guictrlsetfont($bttn010,8,800) GUICtrlSetBkColor($bttn010,0x00ff00) local $edit010 = GUICtrlCreateEdit("", 10, 70, 1080, 650,$ES_AUTOVSCROLL + $WS_VSCROLL + $ws_hscroll + $es_readonly) GUICtrlSetState($edit010, $GUI_DROPACCEPTED) GUICtrlCreatelabel('Enter path to copy files to or hit [ENTER] to select path',10,730,1080,20) guictrlsetfont(-1,10,800) local $copyto = GUICtrlCreateinput('',10,745,1080,20) local $err = GUICtrlCreatelabel('',10,777,1080,20,$ss_sunken) guictrlsetcolor($err,0xff0000) GUISetState() local $hDummy = GUICtrlCreateDummy() Dim $aAccelKeys[1][2] = [["{ENTER}", $hDummy]] GUISetAccelerators($aAccelKeys) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED Switch @GUI_DropId Case $edit010 _copyfiles(guictrlread($edit010)) EndSwitch case $copyto _validate_target_dir() case $hdummy _validate_target_dir() EndSwitch WEnd func _copyfiles($str) local $a_files = stringsplit($str,@crlf,1) ; $a_files contains a crlf delimited list of fully qualified file names _arraydisplay($a_files) endfunc func _validate_target_dir() if guictrlread($copyto) = '' or not FileExists(guictrlread($copyto))then guictrlsetdata($err,'Select a folder to copy to...') GUICtrlSetData($copyto,FileSelectFolder("Choose a folder.", "")) endif endfunc Thanks, kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2011 Moderators Share Posted November 18, 2011 kylomas,$WS_SIZEBOX is a style - $WS_EX_ACCEPTFILES is an extended style. So why are you trying to BitOr or add them together? Just put the correct styles in the correct parameter and all will work as you want: Local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, $WS_SIZEBOX, $WS_EX_ACCEPTFILES)All clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
martin Posted November 18, 2011 Share Posted November 18, 2011 (edited) The reason you can't see the gui is because there isn't one; the guicreate failed because you used an invalid style for an extended style. The reason you see the fileselectfolder dialog is becuse $hDummy is 0 because it failed to create because there is no gui, $nMsg is 0 and the case section selects case $hDummy. Change this line local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, -1, $WS_OVERLAPPEDWINDOW) to this local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, $WS_OVERLAPPEDWINDOW) Edited November 18, 2011 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
kylomas Posted November 18, 2011 Author Share Posted November 18, 2011 Melba23, martin, Thank you and please excuse momentary brain fart !!! kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Zedna Posted November 18, 2011 Share Posted November 18, 2011 (edited) It's good practice to use BitOr($GUI_SS_DEFAULT_GUI, newstyle,...).Local $gui010 = GUICreate("File Copier", 1100, 800, -1, -1, BitOr($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX), $WS_EX_ACCEPTFILES) Edited November 18, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now