Jump to content

Recommended Posts

Posted

Hey. I'm trying to make a toolbar in the extended window frame area, similar to the windows explorer toolbar. As a toolbar, in the example, a label is used. Is it possible to exclude the region occupied by the label from the area of the extended frame of the window so that the label does not shine through and is in its color? How can this be implemented?

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIGdi.au3>
#include <WindowsConstants.au3>
#include <WinAPISysWin.au3>

Global Const $GUI_CAPTION = _WinAPI_GetSystemMetrics($SM_CYCAPTION)
Global Const $GUI_BORDER = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME)
Global Const $GUI_SIZEFRAME = _WinAPI_GetSystemMetrics($SM_CXSIZEFRAME)



$hWnd = GUICreate('', 600, 350)
GUISetBkColor(0)
$Lab = GUICtrlCreateLabel("LABEL"&@TAB&"LABEL"&@TAB&"LABEL"&@TAB&"LABEL"&@TAB&"LABEL"&@TAB&"LABEL"&@TAB&"LABEL"&@TAB&"LABEL", 80, 6, 518, 22)
GUICtrlSetBkColor(-1, 0)
GUICtrlSetColor(-1, 0xFFFFFF)

$hRgn = _WinAPI_CreateRectRgnIndirect(_WinAPI_CreateRectEx(80, 6+$GUI_CAPTION, 518, 22))


_WinAPI_DwmExtendFrameIntoClientArea($hWnd, _WinAPI_CreateMargins(2, 2, 31, 2))

GUISetState()
_WinAPI_ValidateRgn($hWnd, $hRgn)
_WinAPI_InvalidateRgn (GUICtrlGetHandle($Lab), 0, True)

;$wRgn = _WinAPI_CreateRectRgnIndirect(_WinAPI_CreateRectEx(0, 0, 600, 350))
;_WinAPI_CombineRgn ($wRgn, $wRgn, $hRgn, $RGN_DIFF)

;_WinAPI_SetWindowRgn($hWnd, $wRgn)

Do

Until GUIGetMsg() = $GUI_EVENT_CLOSE

 

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