Jump to content
Sign in to follow this  
Rex

Program version in the right site of gui [SOLVED]

Recommended Posts

Rex

Hi

Is there a way to split up my program title and version, so i get to have the version at the right site of program title bar?

GUICreate("Title @Put_this_to_the_right & $Version ", 276, 125, -1, -1) Some thing like this ;)

i did try to use @tab but ended up with a squarer in the title bar :)

Cheers

/Rex

:Edit Titel set to solved ;)

Edited by Rex

Share this post


Link to post
Share on other sites
martin

Hi

Is there a way to split up my program title and version, so i get to have the version at the right site of program title bar?

GUICreate("Title @Put_this_to_the_right & $Version ", 276, 125, -1, -1) Some thing like this ;)

i did try to use @tab but ended up with a squarer in the title bar :)

Cheers

/Rex

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

$guiwid = 600;initial width of window
$Titleleft = " Some Caption";caption for window
$version = "Version 12.4.56"
$packing = ' '

$hG = GUICreate("My GUI", $guiwid, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS)) ; will create a dialog box that when displayed is centered
GUISetState(@SW_SHOW) ; will display an empty dialog box
SetCentreTitle($hG)
GUIRegisterMsg($WM_SIZE, "ReTitle")

$lab = GUICtrlCreatelabel("stretch the window to see the effect",50,200)
GUICtrlSetReSizing($lab, $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()

Func SetCentreTitle($hWnd)
    Local $sTitle
    Local $wp = WinGetPos($hWnd)
    $hDC = _WinAPI_GetDC($hWnd)
    $packing = ' '
    Do
        $packing &= ' '
        $sTitle = $Titleleft & $packing & $version
        $size = _WinAPI_GetTextExtentPoint32($hDC, $sTitle)
    Until DllStructGetData($size, 1) > $wp[2] - 110;110 was by trial and error
    WinSetTitle($hWnd, "", $sTitle)
EndFunc ;==>SetCentreTitle


Func ReTitle($hWnd, $msg, $wParam, $lParam)
    SetCentreTitle($hWnd)
EndFunc ;==>reTitle

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.

Share this post


Link to post
Share on other sites
Rex

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

$guiwid = 600;initial width of window
$Titleleft = " Some Caption";caption for window
$version = "Version 12.4.56"
$packing = ' '

$hG = GUICreate("My GUI", $guiwid, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS)) ; will create a dialog box that when displayed is centered
GUISetState(@SW_SHOW) ; will display an empty dialog box
SetCentreTitle($hG)
GUIRegisterMsg($WM_SIZE, "ReTitle")

$lab = GUICtrlCreatelabel("stretch the window to see the effect",50,200)
GUICtrlSetReSizing($lab, $GUI_DOCKLEFT + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete()

Func SetCentreTitle($hWnd)
    Local $sTitle
    Local $wp = WinGetPos($hWnd)
    $hDC = _WinAPI_GetDC($hWnd)
    $packing = ' '
    Do
        $packing &= ' '
        $sTitle = $Titleleft & $packing & $version
        $size = _WinAPI_GetTextExtentPoint32($hDC, $sTitle)
    Until DllStructGetData($size, 1) > $wp[2] - 110;110 was by trial and error
    WinSetTitle($hWnd, "", $sTitle)
EndFunc ;==>SetCentreTitle


Func ReTitle($hWnd, $msg, $wParam, $lParam)
    SetCentreTitle($hWnd)
EndFunc ;==>reTitle

Cool

thx Just was i was looking for ;)

Cheers

/Rex

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.