Sign in to follow this  
Followers 0
TrueSR

GUICtrlSetResizing on UDF ListView ?

4 posts in this topic

Hey !

I was wondering if you can do something like GUICtrlSetResizing() on a ListView (or other control) created with an UDF.

example code :

#include <GUIConstants.au3>
#include <GuiListView.au3>

$Gui = GUICreate("Gui", 500, 500, 100, 100, BitOr($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
$List = _GUICtrlListView_Create($Gui, "Name|Location", 10, 10, 480, 480)
_GUICtrlListView_SetExtendedListViewStyle($List, $LVS_EX_FULLROWSELECT)

GUISetState()

While 1
$Msg = GUIGetMsg()
If $Msg = $GUI_EVENT_CLOSE Then Exit
WEnd

In this example i want $GUI_DOCKBORDERS (2+4+32+64 = 102 -> see GUICtrlSetResizing() for more info)

Thanks in advance !

Share this post


Link to post
Share on other sites



Hey !

I was wondering if you can do something like GUICtrlSetResizing() on a ListView (or other control) created with an UDF.

example code :

#include <GUIConstants.au3>
#include <GuiListView.au3>

$Gui = GUICreate("Gui", 500, 500, 100, 100, BitOr($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
$List = _GUICtrlListView_Create($Gui, "Name|Location", 10, 10, 480, 480)
_GUICtrlListView_SetExtendedListViewStyle($List, $LVS_EX_FULLROWSELECT)

GUISetState()

While 1
$Msg = GUIGetMsg()
If $Msg = $GUI_EVENT_CLOSE Then Exit
WEnd

In this example i want $GUI_DOCKBORDERS (2+4+32+64 = 102 -> see GUICtrlSetResizing() for more info)

Thanks in advance !

Being that UDF created controls are not monitored by AutoIt internal code you will have to monitor for resizing of the gui and size accordingly. WM_SIZE or something there of.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

TrueSR

Try this:

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

$Gui = GUICreate("Gui", 500, 500, 100, 100, BitOr($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
$List = _GUICtrlListView_Create($Gui, "Name|Location", 10, 10, 480, 480)
_GUICtrlListView_SetExtendedListViewStyle($List, $LVS_EX_FULLROWSELECT)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    
    _WinAPI_MoveWindow($List, 10, 10, $iWidth - 20, $iHeight - 20, True)
    
    Return $GUI_RUNDEFMSG
EndFunc

Share this post


Link to post
Share on other sites

TrueSR

Try this:

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

$Gui = GUICreate("Gui", 500, 500, 100, 100, BitOr($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
$List = _GUICtrlListView_Create($Gui, "Name|Location", 10, 10, 480, 480)
_GUICtrlListView_SetExtendedListViewStyle($List, $LVS_EX_FULLROWSELECT)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    
    Local $iWidth = BitAND($lParam, 0xFFFF)
    Local $iHeight = BitShift($lParam, 16)
    
    _WinAPI_MoveWindow($List, 10, 10, $iWidth - 20, $iHeight - 20, True)
    
    Return $GUI_RUNDEFMSG
EndFunc

Works great, thanks !

Share this post


Link to post
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
Sign in to follow this  
Followers 0