Jump to content

How to disable double-click to fullscreen mode?


gahhon
 Share

Recommended Posts

  • Developers
2 hours ago, gahhon said:

Hi, I wondering is there any way to prevent or disable double-click the application to enter full screen mode?

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.
  :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

2 hours ago, FrancescoDiMuro said:

@gahhon

Could you please post your code?

I don't know what code I should post since I am not sure how and where to disable it.

2 hours ago, Jos said:

Double click doesn't make an application fullscreen but rather changes the window to Maximum. 

Jos

Yeah, it is Maximum. Sorry for the typo.

28 minutes ago, 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.

Can be more specific and simple example how to apply them?

Thanks.

Link to comment
Share on other sites

Link to comment
Share on other sites

1 minute ago, Nine said:

I gave you a simple example, what else do you need ?

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

Link to comment
Share on other sites

Link to comment
Share on other sites

15 hours ago, 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.

So I do need to apply your sample into the Metro UDF, when I am disable the maximum mode?

 

Link to comment
Share on other sites

5 hours ago, gahhon said:

So I do need to apply your sample into the Metro UDF, when I am disable the maximum mode?

Either that if you need some form of toggle, or you can declare your form with the appropriate style (ex. $WS_SIZEBOX)

Link to comment
Share on other sites

1 hour ago, Nine said:

Either that if you need some form of toggle, or you can declare your form with the appropriate style (ex. $WS_SIZEBOX)

Hmm.. I still have no idea where to apply the code ==

#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

Link to comment
Share on other sites

;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 = ...

 

 

Link to comment
Share on other sites

23 hours ago, 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 = ...

 

 

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...