Jump to content

GUI/Form background color changing


 Share

Recommended Posts

  • Moderators

Ok, a bit stumped here on why this isn't working... so I'll speak to the masses.

(Before anyone asks, yes... I'm quite aware of GUISetBkColor and GUICtrlSetBkColor)

I'm trying to change the background of a GUI/Form. I was attempting to do this for tabs rather than having to use a label... but thought it could be universal.

The issue is it simply isn't working, and I'm stumped on why not.

Here is the C code I use that works fine, that I attempted t translate for us here.:

void GUISetFormColor(HWND hWnd, COLORREF nColor)
{
  HBRUSH hBR=CreateSolidBrush(nColor);
  DeleteObject((HBRUSH)SetClassLong(hWnd,GCL_HBRBACKGROUND,(DWORD)hBR));
  InvalidateRect(hWnd,NULL,TRUE);
}

Here is the attempted translation, and a few things added to try and help it along.

Local $hGUI, $iTab, $iTab1
$hGUI = GUICreate("Test GUI", 200, 100)
$iTab = GUICtrlCreateTab(10, 30, 180, 60)
$iTab1 = GUICtrlCreateTabItem("Uno")
GUISetState()
;Try changing the gui back ground first
_GUISetFormColor($hGUI, -1, 0xFF0000)
While GUIGetMsg() <> -3
WEnd

Func _GUISetFormColor($hWnd, $iCtrl = -1, $iColor = 0xFFFFFF)
    Local Const $GCL__HBRBACKGROUND     = -10
    Local Const $RDW__ERASE             = 0x04
    Local Const $RDW__INVALIDATE        = 0x01
    Local Const $RDW__ALLCHILDREN       = 0x080
    Local Const $RDW__UPDATENOW         = 0x100
    
    ;if we are changing a controls bkground, make sure we have the hwnd of it
    Local $aDlg[1] = [$iCtrl], $hBR, $nSCL, $iBGR
    If $iCtrl <> -1 Then
        If IsHWnd($iCtrl) = 0 Then
            $aDlg = DllCall("User32.dll", "hwnd", "GetDlgItem", "hwnd", $hWnd, "int", $iCtrl)
            If @error Or $aDlg[0] = 0 Then Return SetError(1, 0, 0)
        EndIf
        $hWnd = $aDlg[0]
    EndIf
    
    ;translate rgb to bgr in the dll call.
    $hBR = DllCall("Gdi32.dll", "long", "CreateSolidBrush", "int", Int(BitAND($iColor, 0xFF) & _
            BitAND(BitShift($iColor, 8), 0xFF) & BitAND(BitShift($iColor, 16), 0xFF)))
    If @error Then Return SetError(2, 0, 0)

    $nSCL = DllCall("User32.dll", "int", "SetClassLongA", "hwnd", $hWnd, "int", $GCL__HBRBACKGROUND, "dword", $hBR[0])
    If @error Then Return SetError(3, 0, 0)

    DllCall("Gdi32.dll", "int", "DeleteObject", "int", $nSCL[0])
    If @error Then Return SetError(4, 0, 0)

    DllCall("User32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "int", 0, "int", 1)
    If @error Then Return SetError(5, 0, 0)
    
    ;There was a thought the window wasn't refreshing, so attempting to redraw the win
    ;DllCall("User32.dll", "int", "RedrawWindow", "hwnd", $hWnd, "int", 0, "int", 0, "uint", _
    ;   BitOR($RDW__ERASE, $RDW__INVALIDATE, $RDW__ALLCHILDREN, $RDW__UPDATENOW))
    ;If @error Then Return SetError(6, 0, 0)
    
    Return 1
EndFunc

I also tried passing the actual RECT pointer, but that didn't work either.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Bump

P.S. - Who ever moved this to GUI forum... This isn't AutoIt specific.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Bump

P.S. - Who ever moved this to GUI forum... This isn't AutoIt specific.

I moved it. Get's lost too quick over in regular support. GUI doesn't have to be AutoIt specific.

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...

Any news on this issue? :P

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Ok, a bit stumped here on why this isn't working... so I'll speak to the masses.

Hi friend! I'm not sure that this it is correct, but seems this works:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

;Global Const $PATCOPY = 0xF00021

$hGUI = GUICreate("Test", 300, 200)

GUICtrlCreateButton("OK", 10, 160, 75, 25)

GUICtrlCreateButton("Cancel", 220, 160, 75, 25)

GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")

GUISetState()

Do
Until GUIGetMsg() = -3

Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
    Local $hBrush = _WinAPI_CreateSolidBrush(0xFF0000)
    Local $iOldBrush = _WinAPI_SelectObject($wParam, $hBrush)
    
    Local $tRECT = DllStructCreate("int Left;int Top;int Right;int Bottom")
    
    DllCall("Gdi32.dll", "int", "GetClipBox", "hwnd", $wParam, "ptr", DllStructGetPtr($tRECT))
    
    Local $iX = DllStructGetData($tRECT, "Left")
    Local $iY = DllStructGetData($tRECT, "Top")
    Local $iWidth = Number(DllStructGetData($tRECT, "Right") - $iX)
    Local $iHeight = Number(DllStructGetData($tRECT, "Bottom") - $iY)
    
    DllCall("Gdi32.dll", "int", "PatBlt", "hwnd", $wParam, "int", $iX, "int", $iY, "int", $iWidth, _
            "int", $iHeight, "int", $PATCOPY)
    
    _WinAPI_SelectObject($wParam, $iOldBrush)
    _WinAPI_DeleteObject($hBrush)
    
    Return 1
EndFunc

:P

Link to comment
Share on other sites

Hi friend! I'm not sure that this it is correct, but seems this works:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

;Global Const $PATCOPY = 0xF00021

$hGUI = GUICreate("Test", 300, 200)

GUICtrlCreateButton("OK", 10, 160, 75, 25)

GUICtrlCreateButton("Cancel", 220, 160, 75, 25)

GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")

GUISetState()

Do
Until GUIGetMsg() = -3

Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
    Local $hBrush = _WinAPI_CreateSolidBrush(0xFF0000)
    Local $iOldBrush = _WinAPI_SelectObject($wParam, $hBrush)
    
    Local $tRECT = DllStructCreate("int Left;int Top;int Right;int Bottom")
    
    DllCall("Gdi32.dll", "int", "GetClipBox", "hwnd", $wParam, "ptr", DllStructGetPtr($tRECT))
    
    Local $iX = DllStructGetData($tRECT, "Left")
    Local $iY = DllStructGetData($tRECT, "Top")
    Local $iWidth = Number(DllStructGetData($tRECT, "Right") - $iX)
    Local $iHeight = Number(DllStructGetData($tRECT, "Bottom") - $iY)
    
    DllCall("Gdi32.dll", "int", "PatBlt", "hwnd", $wParam, "int", $iX, "int", $iY, "int", $iWidth, _
            "int", $iHeight, "int", $PATCOPY)
    
    _WinAPI_SelectObject($wParam, $iOldBrush)
    _WinAPI_DeleteObject($hBrush)
    
    Return 1
EndFunc

:P

rasim, Smoke_N is trying to get the background colour of the tab to be the same as the gui background and I don't think that does the trick.

Maybe you need to do something like respond to WM_DRAWITEM, get the hdc and floodfill at the top right with the relevant colour.

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.
Link to comment
Share on other sites

rasim, Smoke_N is trying to get the background colour of the tab to be the same as the gui background and I don't think that does the trick.

Maybe you need to do something like respond to WM_DRAWITEM, get the hdc and floodfill at the top right with the relevant colour.

But topic name is GUI/Form background color changing :(

OK, another examples:

1.

Without TabItems ownerdrawing:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global Const $GCL_HBRBACKGROUND = -10

Global $hBrush

$hGUI = GUICreate("Test", 300, 200)

$Tab = GUICtrlCreateTab(10, 10, 280, 180)

$TabItem1 = GUICtrlCreateTabItem("TabItem 1")
$TabItem1 = GUICtrlCreateTabItem("TabItem 2")

GUICtrlCreateTabItem("")

GUISetState()

_GUISetFormColor(GUICtrlGetHandle($Tab), 0xFF0000)

Do
Until GUIGetMsg() = -3

_WinAPI_DeleteObject($hBrush)

Func _GUISetFormColor($hWnd, $sColor)
    $hBrush = _WinAPI_CreateSolidBrush($sColor)
    
    Local $aRet = DllCall("User32.dll", "int", "SetClassLong", "hwnd", $hWnd, "int", $GCL_HBRBACKGROUND, "hwnd", $hBrush)
    If $aRet[0] = 0 Then Return SetError(1, 0, 0)
    
    _WinAPI_InvalidateRect($hWnd, 0)
    
    Return 1
EndFuncoÝ÷ Ù½mh­6"צ²'z·kk§«­¢+Ø¥¹±Õ±ÐíÕ¥
½¹ÍѹÑÍà¹ÔÌÐì(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí]¥¹A$¹ÔÌÐì(¥¹±Õ±ÐíQ
½¹ÍѹÑ̹ÔÌÐì()±½°
½¹ÍÐÀÌØí=}I]9Q%IôÁàÄ)±½°
½¹ÍÐÀÌØí=Q}QôÄÀÄ)±½°
½¹ÍÐÀÌØí
1}! I   
-I=U9ô´ÄÀ()±½°ÀÌØí¡ ÉÕÍ ((ÀÌØí¡U$ôU%
ÉÑ ÅÕ½ÐíQÍÐÅÕ½Ðì°ÌÀÀ°ÈÀÀ¤((ÀÌØíQôU%
Ñɱ
ÉÑQ ÄÀ°ÄÀ°ÈàÀ°ÄàÀ°ÀÌØíQ
M}=]9II]%a¤((ÀÌØíQ%Ñ´ÄôU%
Ñɱ
ÉÑQ%Ñ´ ÅÕ½ÐíQ%Ñ´ÄÅÕ½Ðì¤(ÀÌØíQ%Ñ´ÄôU%
Ñɱ
ÉÑQ%Ñ´ ÅÕ½ÐíQ%Ñ´ÈÅÕ½Ðì¤()U%
Ñɱ
ÉÑQ%Ñ´ ÅÕ½ÐìÅÕ½Ðì¤()U%I¥ÍÑÉ5Í ÀÌØí]5}I]%Q4°ÅÕ½Ðí]5}I]%Q4ÅÕ½Ðì¤()U%MÑMÑÑ ¤()}U%Mѽɵ
½±½È¡U%
ÑɱÑ!¹± ÀÌØíQ¤°ÁáÀÀÀÀ¤()¼)U¹Ñ¥°U%Ñ5Í ¤ô´Ì()}]¥¹A%}±Ñ=©Ð ÀÌØí¡  ÉÕÍ ¤()Õ¹}U%Mѽɵ
½±½È ÀÌØí¡]¹°ÀÌØíÍ
½±½È¤($ÀÌØí¡  ÉÕÍ ô}]¥¹A%}
ÉÑM½±¥ ÉÕÍ  ÀÌØíÍ
½±½È¤($(%1½°ÀÌØíIÐô±±
±° ÅÕ½ÐíUÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíMÑ
±ÍÍ1½¹ÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡]¹°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí
1}! I   
-I=U9°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡   ÉÕÍ ¤(%%ÀÌØíIÑlÁtôÀQ¡¸IÑÕɸMÑÉÉ½È Ä°À°À¤($(%}]¥¹A%}%¹Ù±¥ÑIÐ ÀÌØí¡]¹°À¤($(%IÑÕɸÄ)¹Õ¹()Õ¹]5}I]%Q4 ÀÌØí¡]¹°ÀÌØí5Í°ÀÌØíÝAÉ´°ÀÌØí±AÉ´¤(%1½°ÀÌØíI]%Q5MQIU
P($($ÀÌØíI]%Q5MQIU
Pô±±MÑÉÕÑ
ÉÑ ÅÕ½ÐíÕ¥¹ÐQåÁíÕ¥¹Ð%íÕ¥¹Ð¥Ñµ%íÕ¥¹Ð¥ÑµÑ¥½¸íÕ¥¹Ð¥ÑµMÑÑìÅÕ½ÐìµÀì|($$$$$$$$$ÅÕ½Ðí¡Ý¹¡%Ñ´í¡Ý¹¡íݽɥѵIÑlÑtíݽɥѵÑÅÕ½Ðì°ÀÌØí±AÉ´¤($(%%±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½ÐíQåÁÅÕ½Ð줱ÐìÐìÀÌØí=Q}QQ¡¸IÑÕɸÀÌØíU%}IU95M($(%1½°ÀÌØí%ô±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí%ÅÕ½Ðì¤(1½°ÀÌØí¥Ñµ%ô±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥Ñµ%ÅÕ½Ðì¤(1½°ÀÌØí¥ÑµÑ¥½¸ô±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµÑ¥½¸ÅÕ½Ðì¤(1½°ÀÌØí¥ÑµMÑÑô±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµMÑÑÅÕ½Ðì¤(1½°ÀÌØí¡%Ñ´ô±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¡%Ñ´ÅÕ½Ðì¤(1½°ÀÌØí¡ô±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¡ÅÕ½Ðì¤($(%%ÀÌØí¥ÑµÑ¥½¸±ÐìÐìÀÌØí=}I]9Q%IQ¡¸IÑÕɸÀÌØíU%}IU95M($(%1½°ÀÌØí¥ÑµQáаÀÌØí¥  ÉÕÍ¡
½±½ÈôÁáÀÀÀÀ($(%11
±° ÅÕ½Ðí¤Ìȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíMÑ    ­5½ÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°Ä¤($(%1½°ÀÌØí¥    ÉÕÍ ô11
±° ÅÕ½Ðí¤Ìȹ±°ÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÅÕ½Ðí
ÉÑM½±¥ ÉÕÍ ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí¥   ÉÕÍ¡
½±½È¤($ÀÌØí¥  ÉÕÍ ôÀÌØí¥ ÉÕÍ¡lÁt($(%1½°ÀÌØí¥ ÉÕÍ¡=±ô}]¥¹A%}M±Ñ=©Ð ÀÌØí¡°ÀÌØí¥ ÉÕÍ ¤($($í11
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½Ðí¥±±IÐÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡°ÅÕ½ÐíÁÑÈÅÕ½Ðì°±±MÑÉÕÑÑAÑÈ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµIÐÅÕ½Ð줰ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¥  ÉÕÍ ¤($(%MÝ¥Ñ ÀÌØí¥Ñµ%($%
ÍÀ($$$ÀÌØí¥ÑµQáÐôÅÕ½ÐíQ%Ñ´ÄÅÕ½Ðì($%
ÍÄ($$$ÀÌØí¥ÑµQáÐôÅÕ½ÐíQ%Ñ´ÈÅÕ½Ðì(%¹MÝ¥Ñ ($(%±±MÑÉÕÑMÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµIÐÅÕ½Ðì°±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµIÐÅÕ½Ðì°Ä¤¬Ô°Ä¤(%±±MÑÉÕÑMÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµIÐÅÕ½Ðì°±±MÑÉÕÑÑÑ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµIÐÅÕ½Ðì°È¤¬Ô°È¤($(%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíÉÝQáÐÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØí¡°ÅÕ½ÐíÍÑÈÅÕ½Ðì°ÀÌØí¥ÑµQáаÅÕ½Ðí¥¹ÐÅÕ½Ðì°MÑÉ¥¹1¸ ÀÌØí¥ÑµQáФ°|($$$ÅÕ½ÐíÁÑÈÅÕ½Ðì°±±MÑÉÕÑÑAÑÈ ÀÌØíI]%Q5MQIU
P°ÅÕ½Ðí¥ÑµIÐÅÕ½Ð줰ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØíQ}1P¤($(}]¥¹A%}M±Ñ=©Ð ÀÌØí¡°ÀÌØí¥ ÉÕÍ¡=±¤(%}]¥¹A%}±Ñ=©Ð ÀÌØí¥    ÉÕÍ ¤($(%IÑÕɸÀÌØíU%}IU95M)¹Õ¹

:P

Link to comment
Share on other sites

Delete unnecessary code parts:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <TabConstants.au3>

Global Const $ODA_DRAWENTIRE = 0x1
Global Const $ODT_TAB = 101
Global Const $GCL_HBRBACKGROUND = -10

Global $hBrush

$hGUI = GUICreate("Test", 300, 200)

$Tab = GUICtrlCreateTab(10, 10, 280, 180, $TCS_OWNERDRAWFIXED)

$TabItem1 = GUICtrlCreateTabItem("TabItem 1")
$TabItem1 = GUICtrlCreateTabItem("TabItem 2")

GUICtrlCreateTabItem("")

GUIRegisterMsg($WM_DRAWITEM, "WM_DRAWITEM")

GUISetState()

_GUISetFormColor(GUICtrlGetHandle($Tab), 0xFF0000)

Do
Until GUIGetMsg() = -3

_WinAPI_DeleteObject($hBrush)

Func _GUISetFormColor($hWnd, $sColor)
    $hBrush = _WinAPI_CreateSolidBrush($sColor)
    
    Local $aRet = DllCall("User32.dll", "int", "SetClassLong", "hwnd", $hWnd, "int", $GCL_HBRBACKGROUND, "hwnd", $hBrush)
    If $aRet[0] = 0 Then Return SetError(1, 0, 0)
    
    _WinAPI_InvalidateRect($hWnd, 0)
    
    Return 1
EndFunc

Func WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam)
    Local $DRAWITEMSTRUCT
    
    $DRAWITEMSTRUCT = DllStructCreate("uint cType;uint cID;uint itmID;uint itmAction;uint itmState;" & _
                                      "hwnd hItm;hwnd hDC;dword itmRect[4];dword itmData", $lParam)
    
    If DllStructGetData($DRAWITEMSTRUCT, "cType") <> $ODT_TAB Then Return $GUI_RUNDEFMSG
    
    ;Local $cID = DllStructGetData($DRAWITEMSTRUCT, "cID")
    Local $itmID = DllStructGetData($DRAWITEMSTRUCT, "itmID")
    Local $itmAction = DllStructGetData($DRAWITEMSTRUCT, "itmAction")
    ;Local $itmState = DllStructGetData($DRAWITEMSTRUCT, "itmState")
    ;Local $hItm = DllStructGetData($DRAWITEMSTRUCT, "hItm")
    Local $hDC = DllStructGetData($DRAWITEMSTRUCT, "hDC")
    
    If $itmAction <> $ODA_DRAWENTIRE Then Return $GUI_RUNDEFMSG
    
    Local $itmText
    
    DLLCall("gdi32.dll","int","SetBkMode", "hwnd", $hDC, "int", 1)
    
    Switch $itmID
        Case 0
            $itmText = "TabItem 1"
        Case 1
            $itmText = "TabItem 2"
    EndSwitch
    
    DllStructSetData($DRAWITEMSTRUCT, "itmRect", DllStructGetData($DRAWITEMSTRUCT, "itmRect", 1) + 5, 1)
    DllStructSetData($DRAWITEMSTRUCT, "itmRect", DllStructGetData($DRAWITEMSTRUCT, "itmRect", 2) + 5, 2)
    
    DllCall("user32.dll", "int", "DrawText", "hwnd", $hDC, "str", $itmText, "int", StringLen($itmText), _
            "ptr", DllStructGetPtr($DRAWITEMSTRUCT, "itmRect"), "int", $DT_LEFT)
    
    Return $GUI_RUNDEFMSG
EndFunc

:P

Link to comment
Share on other sites

Delete unnecessary code parts:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <TabConstants.au3>

Global Const $ODA_DRAWENTIRE = 0x1
Global Const $ODT_TAB = 101
Global Const $GCL_HBRBACKGROUND = -10

Global $hBrush

$hGUI = GUICreate("Test", 300, 200)

$Tab = GUICtrlCreateTab(10, 10, 280, 180, $TCS_OWNERDRAWFIXED)

$TabItem1 = GUICtrlCreateTabItem("TabItem 1")
$TabItem1 = GUICtrlCreateTabItem("TabItem 2")

GUICtrlCreateTabItem("")

GUIRegisterMsg($WM_DRAWITEM, "WM_DRAWITEM")

GUISetState()

_GUISetFormColor(GUICtrlGetHandle($Tab), 0xFF0000)

Do
Until GUIGetMsg() = -3

_WinAPI_DeleteObject($hBrush)

Func _GUISetFormColor($hWnd, $sColor)
    $hBrush = _WinAPI_CreateSolidBrush($sColor)
    
    Local $aRet = DllCall("User32.dll", "int", "SetClassLong", "hwnd", $hWnd, "int", $GCL_HBRBACKGROUND, "hwnd", $hBrush)
    If $aRet[0] = 0 Then Return SetError(1, 0, 0)
    
    _WinAPI_InvalidateRect($hWnd, 0)
    
    Return 1
EndFunc

Func WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam)
    Local $DRAWITEMSTRUCT
    
    $DRAWITEMSTRUCT = DllStructCreate("uint cType;uint cID;uint itmID;uint itmAction;uint itmState;" & _
                                      "hwnd hItm;hwnd hDC;dword itmRect[4];dword itmData", $lParam)
    
    If DllStructGetData($DRAWITEMSTRUCT, "cType") <> $ODT_TAB Then Return $GUI_RUNDEFMSG
    
    ;Local $cID = DllStructGetData($DRAWITEMSTRUCT, "cID")
    Local $itmID = DllStructGetData($DRAWITEMSTRUCT, "itmID")
    Local $itmAction = DllStructGetData($DRAWITEMSTRUCT, "itmAction")
    ;Local $itmState = DllStructGetData($DRAWITEMSTRUCT, "itmState")
    ;Local $hItm = DllStructGetData($DRAWITEMSTRUCT, "hItm")
    Local $hDC = DllStructGetData($DRAWITEMSTRUCT, "hDC")
    
    If $itmAction <> $ODA_DRAWENTIRE Then Return $GUI_RUNDEFMSG
    
    Local $itmText
    
    DLLCall("gdi32.dll","int","SetBkMode", "hwnd", $hDC, "int", 1)
    
    Switch $itmID
        Case 0
            $itmText = "TabItem 1"
        Case 1
            $itmText = "TabItem 2"
    EndSwitch
    
    DllStructSetData($DRAWITEMSTRUCT, "itmRect", DllStructGetData($DRAWITEMSTRUCT, "itmRect", 1) + 5, 1)
    DllStructSetData($DRAWITEMSTRUCT, "itmRect", DllStructGetData($DRAWITEMSTRUCT, "itmRect", 2) + 5, 2)
    
    DllCall("user32.dll", "int", "DrawText", "hwnd", $hDC, "str", $itmText, "int", StringLen($itmText), _
            "ptr", DllStructGetPtr($DRAWITEMSTRUCT, "itmRect"), "int", $DT_LEFT)
    
    Return $GUI_RUNDEFMSG
EndFunc

:P

I don't get it :(

How do you use this to have a tab control with normal coloured tabs but have the top right background of the tab to be the same colour as the gui background?

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.
Link to comment
Share on other sites

Nice rasim!

The main question here (for me anyway) is how this method can be used to set background color for created windows with _WinAPI_CreateWindowEx()? Because there is need sometimes to set bk color on "external level".

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Nice rasim!

The main question here (for me anyway) is how this method can be used to set background color for created windows with _WinAPI_CreateWindowEx()? Because there is need sometimes to set bk color on "external level".

The SysLink control receives messages similar a static control:

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global Const $TRANSPARENT = 1

$hGUI = GUICreate("Test", 300, 200)

$hSysLink = _GuiCtrlSysLink_Create($hGUI, "www.autoitscript.com", 50, 50, 140, 20)

GUIRegisterMsg($WM_CTLCOLORSTATIC, "WM_CTLCOLORSTATIC")

GUISetState()

Do
Until GUIGetMsg() = -3

Func _GuiCtrlSysLink_Create($hParent, $sText, $sX, $sY, $sWidth, $sHeight)
    Local $hWnd = _WinAPI_CreateWindowEx(0, "SysLink", $sText, _
                            BitOR($WS_CHILD, $WS_VISIBLE), $sX, $sY, $sWidth, $sHeight, $hParent)
    Return $hWnd
EndFunc

Func WM_CTLCOLORSTATIC($hWnd, $Msg, $wParam, $lParam)
    If $lParam = $hSysLink Then
        ;DllCall("gdi32.dll", "int", "SetBkMode", "hwnd", $wParam, "int", $TRANSPARENT)
    
        DllCall("gdi32.dll", "int", "SetTextColor", "hwnd", $wParam, "int", 0xFF0000)
        DllCall("gdi32.dll", "int", "SetBkColor", "hwnd", $wParam, "int", 0x0000FF)
        
        Return _WinAPI_GetStockObject($GRAY_BRUSH)
    EndIf
    
    Return $GUI_RUNDEFMSG
EndFunc

:P

Link to comment
Share on other sites

The SysLink control receives messages similar a static control:

It works! :( Thanks!

But the background window (not the control) still can not be changed... well actualy it can, but only to gray/white (when the function return _WinAPI_GetStockObject($GRAY_BRUSH)).

P.S

And what if we wanted to change background color for an external application, for example for Notepad? :P i think this is the main challenge here...

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

You can use any Brush to apply to the BG-window :P But if you create one with _WinApi_CreateSolidBrush, you have to delete it again at the end of the Script ( _WinApi_DeleteObject )

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global Const $TRANSPARENT = 1

Global Const $LWS_TRANSPARENT = 1
Global Const $LWS_IGNORERETURN = 2
Global Const $LWS_NOPREFIX = 4 ; VISTA ONLY
Global Const $LWS_USEVISUALSTYLE = 8 ; VISTA ONLY
Global Const $LWS_USECUSTOMTEXT = 0x0010 ; VISTA ONLY
Global Const $LWS_RIGHT = 0x0020 ; VISTA ONLY

Global $_GLOB_BG_BRUSH = _WinAPI_CreateSolidBrush(0x00FF0000)

$hGUI = GUICreate("Test", 300, 200)

$hSysLink = _GuiCtrlSysLink_Create($hGUI, "www.autoitscript.com<a>www.autoitscript.com</a>", 50, 50, 240, 60,$WS_TABSTOP,0)
GUICtrlCreateButton("",10,10)
GUIRegisterMsg($WM_CTLCOLORSTATIC, "WM_CTLCOLORSTATIC")

GUISetState()

Do
Until GUIGetMsg() = -3

Func OnAutoItExit()
    _WinAPI_DeleteObject($_GLOB_BG_BRUSH)
EndFunc

Func _GuiCtrlSysLink_Create($hParent, $sText, $sX, $sY, $sWidth, $sHeight,$Style=0,$ExStyle=0)
    $Style = BitOR($Style, $WS_CHILD, $WS_VISIBLE)
    Local $hWnd = _WinAPI_CreateWindowEx($ExStyle, "SysLink", $sText, _
                            $Style, $sX, $sY, $sWidth, $sHeight, $hParent)
    Return $hWnd
EndFunc

Func WM_CTLCOLORSTATIC($hWnd, $Msg, $wParam, $lParam)
    If $lParam = $hSysLink Then
;~         DllCall("gdi32.dll", "int", "SetBkMode", "hwnd", $wParam, "int", $TRANSPARENT)
   
        DllCall("gdi32.dll", "int", "SetTextColor", "hwnd", $wParam, "int", _WinAPI_GetSysColor(17)) ; COLOR_GRAYTEXT
        DllCall("gdi32.dll", "int", "SetBkColor", "hwnd", $wParam, "int", _WinAPI_GetSysColor(15)) ; COLOR_3DFACE

        Return $_GLOB_BG_BRUSH
;        Return _WinAPI_GetSysColorBrush(13) ; COLOR_HILIGHT)
    EndIf
   
    Return $GUI_RUNDEFMSG
EndFunc

With _WinAPI_GetSysColorBrush you can get the default system colors as brush, but you must not delete the Brush at the end,

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

@rasim, ProgAndy

I am lost with the examples you have posted. :P

I don't see how they help with the problem in post #1. Can you show an example where the tab background colour is fixed?

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.
Link to comment
Share on other sites

Oops, didN#t see, that this didn't belong to post, sorry. If you want to Style your tab, you have to use ownerdrawn style or you have to dusable Themes.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <TabConstants.au3>

Global Const $GCL_HBRBACKGROUND = -10

$hGUI = GUICreate("Test", 300, 200)

$OLD = _SetThemes(0)
$Tab = GUICtrlCreateTab(10, 10, 280, 180)
_SetThemes($OLD)

$TabItem1 = GUICtrlCreateTabItem("TabItem 1")
$TabItem1 = GUICtrlCreateTabItem("TabItem 2")
GUICtrlCreateButton("test - Themes on again",100,40)
GUICtrlCreateTabItem("")

GUISetState()

Local $hBrush = _GUISetFormColor(GUICtrlGetHandle($Tab), _WinAPI_GetSysColor(13))

Do
Until GUIGetMsg() = -3

_WinAPI_DeleteObject($hBrush)

Func _GUISetFormColor($hWnd, $sColor)
    Local $hBrush = _WinAPI_CreateSolidBrush($sColor)
   
    Local $aRet = DllCall("User32.dll", "int", "SetClassLong", "hwnd", $hWnd, "int", $GCL_HBRBACKGROUND, "hwnd", $hBrush)
    If $aRet[0] = 0 Then Return SetError(1, 0, 0*_WinAPI_DeleteObject($hBrush))
   _WinAPI_DeleteObject($aRet[0])
    _WinAPI_InvalidateRect($hWnd, 0)
   
    Return $hBrush
EndFunc

; returns old theme value
; by Prog@ndy
Func _SetThemes($Style)
    If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1)
    Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties")
    If Not IsArray($ret) Then Return SetError(1,0,-1)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style)
    Return $ret[0]
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Oops, didN#t see, that this didn't belong to post, sorry. If you want to Style your tab, you have to use ownerdrawn style or you have to dusable Themes.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <TabConstants.au3>

Global Const $GCL_HBRBACKGROUND = -10

$hGUI = GUICreate("Test", 300, 200)

$OLD = _SetThemes(0)
$Tab = GUICtrlCreateTab(10, 10, 280, 180)
_SetThemes($OLD)

$TabItem1 = GUICtrlCreateTabItem("TabItem 1")
$TabItem1 = GUICtrlCreateTabItem("TabItem 2")
GUICtrlCreateButton("test - Themes on again",100,40)
GUICtrlCreateTabItem("")

GUISetState()

Local $hBrush = _GUISetFormColor(GUICtrlGetHandle($Tab), _WinAPI_GetSysColor(13))

Do
Until GUIGetMsg() = -3

_WinAPI_DeleteObject($hBrush)

Func _GUISetFormColor($hWnd, $sColor)
    Local $hBrush = _WinAPI_CreateSolidBrush($sColor)
   
    Local $aRet = DllCall("User32.dll", "int", "SetClassLong", "hwnd", $hWnd, "int", $GCL_HBRBACKGROUND, "hwnd", $hBrush)
    If $aRet[0] = 0 Then Return SetError(1, 0, 0*_WinAPI_DeleteObject($hBrush))
   _WinAPI_DeleteObject($aRet[0])
    _WinAPI_InvalidateRect($hWnd, 0)
   
    Return $hBrush
EndFunc

; returns old theme value
; by Prog@ndy
Func _SetThemes($Style)
    If @OSType = "WIN32_WINDOWS" Or $Style=-1 Then Return SetError(1,0,-1)
    Local $ret = DllCall("uxtheme.dll", "dword", "GetThemeAppProperties")
    If Not IsArray($ret) Then Return SetError(1,0,-1)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "dword", $Style)
    Return $ret[0]
EndFunc
Ok, but that still doesn't fix the background colour at the top right of the tab control. I thought there might be a way to find the DC for the tab control, not the tab items, and then you could colour it.

I tried this but it fills the whole tab. It should just fill a region bounded by another clour. I don't understand why it doesn't work.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <TabConstants.au3>

Global Const $GCL_HBRBACKGROUND = -10
Const $FLOODFILLBORDER  = 0, $FLOODFILLSURFACE = 1

$hGUI = GUICreate("Test", 300, 200)


$Tab = GUICtrlCreateTab(10, 10, 280, 180)


$TabItem1 = GUICtrlCreateTabItem("TabItem 1")
$TabItem1 = GUICtrlCreateTabItem("TabItem 2")
$btn = GUICtrlCreateButton("test - floodfill",100,40)
GUICtrlCreateTabItem("")

GUISetState()
$pic_hdc = DLLCall("user32.dll","int","GetDC","hwnd",GUICtrlGetHandle($Tab))
$hBrush = DllCall("gdi32.dll", "long", "CreateSolidBrush", "int", 0xFF00FF)
$obj_orig = DLLCall("gdi32.dll","int","SelectObject","int",$pic_hdc[0],"int",$hBrush[0])


Do
    $msg = GUIGetMsg() 
    if $msg = -3 then exitloop
    if $msg = $btn then DllCall("gdi32.dll","int","FloodFill","int",$pic_hdc[0],"int",275,"int",2,"int",$FLOODFILLSURFACE)
Until 0


DLLCall("gdi32.dll","int","SelectObject","int",$pic_hdc[0],"int",$obj_orig[0])
DLLCall("gdi32.dll","int","DeleteObject","int",$hBrush[0])
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.
Link to comment
Share on other sites

  • Moderators

Oops, didN#t see, that this didn't belong to post, sorry. If you want to Style your tab, you have to use ownerdrawn style or you have to dusable Themes.

You solution is close. As I've said, I have this working in other languages exactly how I've presented it, so using uxtheme.dll should not be an option. I'm more curious why it's not working, than it to actually work now to be honest. I have a feeling a dev is the only one that can answer that.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

It works! :P Thanks!

But the background window (not the control) still can not be changed... well actualy it can, but only to gray/white (when the function return _WinAPI_GetStockObject($GRAY_BRUSH)).

Return a null brush

Return _WinAPI_GetStockObject($NULL_BRUSH)
Edited by rasim
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...