Jump to content

Recommended Posts

Posted

Hello, 

Can I set resize GUI only diagonally? 

This is not good enough:

$hgui = GUICreate($name, $GuiWidth, $GuiHeight, 0, 0, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_MAXIMIZEBOX))

 It lets me resize width and height separately. 

Posted
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$widht = 300
$height = 120

$hgui = GUICreate("",$widht,$height, 0, 0, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_RESIZED
            ;$aPos = WinGetPos($hgui)
            $aPos = WinGetClientSize ($hgui)
            If $aPos[1] <> $height Then
                WinMove($hgui,"",Default,Default,$aPos[0]+14,$height+14)
            EndIf

    EndSwitch
WEnd

Something like? Not perfect but a start point

Posted

Thanx, This is how I fixed it:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$widht = 600
$height = 400

$hgui = GUICreate("",$widht,$height, 0, 0, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_RESIZED
            $aPos = WinGetClientSize ($hgui)
            WinMove($hgui,"",Default,Default,$aPos[0],$aPos[0]/($widht/$height))
    EndSwitch
WEnd

But can i just disable the appearance of the <-> symbol (of the mouse) when I touch the right (or left or top or bottom) border of the widow.

I want it to be resized only from corners.

Posted

You can do something like this:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$widht = 600
$height = 400

$hgui = GUICreate("",$widht,$height, Default, Default, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
GUISetState(@SW_SHOW)



GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_RESIZED
            $aPos = WinGetClientSize ($hgui)
            WinMove($hgui,"",Default,Default,$aPos[0],$aPos[0]/($widht/$height))
    EndSwitch
WEnd

Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
Local $aPos=MouseGetPos()
Local $aWin=WinGetPos($hWnd)
Local $imX=$aPos[0]
Local $imY=$aPos[1]
Local $iwX=$aWin[0]+$aWin[2]-8
Local $iwY=$aWin[1]+$aWin[3]-8
If not ($imX>$iwX and $imX<$iwX+8  and $imY>$iwY and $imY<$iwY+8) Then Return 0
EndFunc

Saludos

Posted

Very nice @Danyfirex

mLipok

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 10/26/2015 at 12:12 AM, UritOR said:

That's works exactly as I want =) muchas gracias

 

De nada ;)

  On 10/26/2015 at 12:34 AM, mLipok said:

Very nice @Danyfirex

mLipok

 

thank you bro 

Saludos

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
  • Recently Browsing   0 members

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