gahhon Posted January 13, 2019 Posted January 13, 2019 Hi, I wondering is there any way to prevent or disable double-click the application to enter full screen mode? To prevent the interface off-alignment while in full screen mode. Thanks
FrancescoDiMuro Posted January 13, 2019 Posted January 13, 2019 @gahhon Are you talking about your application written in AutoIt or an external application? Click here to see my signature: Reveal hidden contents ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
gahhon Posted January 13, 2019 Author Posted January 13, 2019 On 1/13/2019 at 8:39 AM, FrancescoDiMuro said: @gahhon Are you talking about your application written in AutoIt or an external application? Expand In AutoIT. The interface I was use is Metro UDF
FrancescoDiMuro Posted January 13, 2019 Posted January 13, 2019 @gahhon Could you please post your code? Click here to see my signature: Reveal hidden contents ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Developers Jos Posted January 13, 2019 Developers Posted January 13, 2019 On 1/13/2019 at 8:18 AM, gahhon said: Hi, I wondering is there any way to prevent or disable double-click the application to enter full screen mode? Expand Double click doesn't make an application fullscreen but rather changes the window to Maximum. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Nine Posted January 13, 2019 Posted January 13, 2019 Change the window style so it cannot be resized like : $Style = _WinAPI_GetWindowLong($hWnd,$GWL_STYLE) If BitXOR($Set,BitAND($Style,$WS_SIZEBOX)) Then _WinAPI_SetWindowLong($hWnd,$GWL_STYLE,BitXOR($Style,$WS_SIZEBOX)) _WinAPI_SetWindowPos ($hWnd,null,0,0,$WindowX,$WindowY,$SWP_FRAMECHANGED) EndIf where $set toggle the window style. “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted January 13, 2019 Author Posted January 13, 2019 On 1/13/2019 at 11:13 AM, FrancescoDiMuro said: @gahhon Could you please post your code? Expand I don't know what code I should post since I am not sure how and where to disable it. On 1/13/2019 at 11:16 AM, Jos said: Double click doesn't make an application fullscreen but rather changes the window to Maximum. Jos Expand Yeah, it is Maximum. Sorry for the typo. On 1/13/2019 at 1:17 PM, Nine said: Change the window style so it cannot be resized like : $Style = _WinAPI_GetWindowLong($hWnd,$GWL_STYLE) If BitXOR($Set,BitAND($Style,$WS_SIZEBOX)) Then _WinAPI_SetWindowLong($hWnd,$GWL_STYLE,BitXOR($Style,$WS_SIZEBOX)) _WinAPI_SetWindowPos ($hWnd,null,0,0,$WindowX,$WindowY,$SWP_FRAMECHANGED) EndIf where $set toggle the window style. Expand Can be more specific and simple example how to apply them? Thanks.
Nine Posted January 13, 2019 Posted January 13, 2019 On 1/13/2019 at 1:46 PM, gahhon said: Can be more specific and simple example how to apply them? Expand I gave you a simple example, what else do you need ? “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted January 13, 2019 Author Posted January 13, 2019 On 1/13/2019 at 3:11 PM, Nine said: I gave you a simple example, what else do you need ? Expand I was thought that should be key/function will trigger the double-click event. So my question is how to apply your method into that event tho. Thanks
Nine Posted January 13, 2019 Posted January 13, 2019 It is a change of paradigm. Instead of trying to intercept an event, you simply disable the whole resizable feature of a window. “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted January 14, 2019 Author Posted January 14, 2019 On 1/13/2019 at 3:17 PM, Nine said: It is a change of paradigm. Instead of trying to intercept an event, you simply disable the whole resizable feature of a window. Expand So I do need to apply your sample into the Metro UDF, when I am disable the maximum mode?
Nine Posted January 14, 2019 Posted January 14, 2019 On 1/14/2019 at 7:15 AM, gahhon said: So I do need to apply your sample into the Metro UDF, when I am disable the maximum mode? Expand Either that if you need some form of toggle, or you can declare your form with the appropriate style (ex. $WS_SIZEBOX) “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted January 14, 2019 Author Posted January 14, 2019 On 1/14/2019 at 12:31 PM, Nine said: Either that if you need some form of toggle, or you can declare your form with the appropriate style (ex. $WS_SIZEBOX) Expand Hmm.. I still have no idea where to apply the code == expandcollapse popup#NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\Downloads\ALlogo.ico #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_HiDpi=y #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; =============================================================================================================================== ; Name ..........: AutoLogin's Main Application ; Version .......: v1.0 ; Author ........: Jack Wong ; Resource ......: https://www.autoitscript.com/forum/files/file/365-metrogui-udf/ ; =============================================================================================================================== ;!Highly recommended for improved overall performance and responsiveness of the GUI effects etc.! (after compiling): ;YOU NEED TO EXCLUDE FOLLOWING FUNCTIONS FROM AU3STRIPPER, OTHERWISE IT WON'T WORK: #Au3Stripper_Ignore_Funcs=_iHoverOn,_iHoverOff,_iFullscreenToggleBtn,_cHvr_CSCP_X64,_cHvr_CSCP_X86,_iControlDelete ;Please not that Au3Stripper will show errors. You can ignore them as long as you use the above Au3Stripper_Ignore_Funcs parameters. ;Required if you want High DPI scaling enabled. (Also requries _Metro_EnableHighDPIScaling()) ; =============================================================================================================================== #include "MetroGUI-UDF\MetroGUI_UDF.au3" #include "MetroGUI-UDF\_GUIDisable.au3" ; For dim effects when msgbox is displayed #include <GUIConstants.au3> #include <Array.au3> #include <File.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <Crypt.au3> #include <Misc.au3> ;=======================================================================Creating the GUI=============================================================================== ;Enable high DPI support: Detects the users DPI settings and resizes GUI and all controls to look perfectly sharp. _Metro_EnableHighDPIScaling() ; Note: Requries "#AutoIt3Wrapper_Res_HiDpi=y" for compiling. To see visible changes without compiling, you have to disable dpi scaling in compatibility settings of Autoit3.exe ;Set Theme _SetTheme("DarkBlueV2") ;See MetroThemes.au3 for selectable themes or to add more ;Create resizable Metro GUI $GUI_MAIN = _Metro_CreateGUI("", 480, 400, -1, -1, True) ;Add/create control buttons to the GUI $Control_Buttons = _Metro_AddControlButtons(True, False, True, False, False) ;CloseBtn = True, MaximizeBtn = True, MinimizeBtn = True, FullscreenBtn = True, MenuBtn = True ;Set variables for the handles of the GUI-Control buttons. (Above function always returns an array this size and in this order, no matter which buttons are selected.) $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] ;====================================================================================================================================================================== ;Create Buttons (Text, PositionX, Position Y, Width, Height) $BTN_LOCKED = _Metro_CreateButtonEx2("Lock Folder", 130, 100, 225, 40) $BTN_UNLOCKED = _Metro_CreateButtonEx2("Unlock Folder", 130, 150, 225, 40) $BTN_OPEN_DIR = _Metro_CreateButtonEx2("Open Folder", 130, 200, 225, 40) $BTN_CHANGE_PASSWORD = _Metro_CreateButtonEx2("Change Password", 130, 250, 225, 40) $BTN_EXIT = _Metro_CreateButtonEx2("Exit", 130, 300, 225, 40) ;Create Label for Main GUI _Metro_CreateLabel("Jack IT - Folder Lock Management", 137, 40, 400, 40) _Metro_AddHSeperator(10, 70, 460, 3) ;Create Global & Constant Variables Global Const $DIR_PASSWORD = @AppDataDir & '\Jack IT - Folder Lock Management' Global Const $INI_PASSWORD = $DIR_PASSWORD & '\FolderLock.ini' Global Const $INI_PASSWORD_ENCRYPT = $DIR_PASSWORD & '\FolderLock.crypt' Global Const $DIR_FOLDER = @MyDocumentsDir & '\MyFolderLock' _Initial_Files_Check() _Security_Check() _Login('FolderLockPassword') GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON, $BTN_EXIT _Encryption() _GUIDisable($GUI_MAIN, 0, 30) _Close_Application() Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE, $GUI_MAIN) Case $BTN_LOCKED _GUIDisable($GUI_MAIN, 0, 30) _Lock_Folder() _GUIDisable($GUI_MAIN) Case $BTN_UNLOCKED _GUIDisable($GUI_MAIN, 0, 30) _Unlock_Folder() _GUIDisable($GUI_MAIN) Case $BTN_OPEN_DIR _Open_Folder() Case $BTN_CHANGE_PASSWORD _GUIDisable($GUI_MAIN, 0, 30) _Password_Management(0, 'FolderLockPassword') _GUIDisable($GUI_MAIN) EndSwitch WEnd ;FUNCTIONS SECTION In application I had included the Metro UDF and FolderLock by Meerecat. So I think I should be done within the Metro USF script or on the script above Please be note that $Control_Buttons are to set whether to display the buttons or not, and it doesn't do anything with the disable maximize function. I am truly apology that I am still unable to apply your sample code, and also I am very appreciate that you can helps me out. Thanks
Nine Posted January 14, 2019 Posted January 14, 2019 ;Create resizable Metro GUI $GUI_MAIN = _Metro_CreateGUI("", 480, 400, -1, -1, True) Well, I don't know if that True there means resizable...put it to false and test to maximize your GUI form. If that doesnt work (since you dont want to play in the Metro UDF), you will have to create a small func with my code and call it just after your $GUI_MAIN = ... gahhon 1 “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
gahhon Posted January 15, 2019 Author Posted January 15, 2019 On 1/14/2019 at 2:42 PM, Nine said: ;Create resizable Metro GUI $GUI_MAIN = _Metro_CreateGUI("", 480, 400, -1, -1, True) Well, I don't know if that True there means resizable...put it to false and test to maximize your GUI form. If that doesnt work (since you dont want to play in the Metro UDF), you will have to create a small func with my code and call it just after your $GUI_MAIN = ... Expand Awesome. After I check the UDF of the _Metro_CreateGUI function, it stated as $AllowResize. Thus, I changed it to False and work as expected. Before this, I am keep looking the _Metro_FullscreenToggle LOL. Anyway, Thanks alot.
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