Jump to content

Help with gui bk color


Draygoes
 Share

Recommended Posts

I have the code for black right. Im sure of it. Try it and see what color comes out...

#include<GUIConstants.au3>

$tool = GUICreate( "tool", 250, 700, default - -750, Default, $WS_POPUP + $WS_VSCROLL, $WS_EX_TOOLWINDOW )
WinSetTrans( "tool","", 1500)
guisetstate()
GUISetBkColor( $tool, 0x000000)
While 1
    WEnd

could any one help?

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

GUISetBkColor( $tool, 0x000000)

doesn't seem to be the same as

GUISetBkColor( background [, winhandle] )

Btw Transparency value of 1500 is noncompliant with the Autoit Help too.

In other words, RTFM

:)

Edited by Siao

"be smart, drink your wine"

Link to comment
Share on other sites

Btw Transparency value of 1500 is noncompliant with the Autoit Help too.

Oddly enough it still works as you go higher ... 10000 will make it fairly transparent. Bug ... dunno ...

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

Oddly enough it still works as you go higher ... 10000 will make it fairly transparent. Bug ... dunno ...

Well, it doesn't crash, but it only takes 1 byte from 10000 :)

Transparency is 1 byte.

Transparency 10000 (0x2710) = 16 (0x10)

Edited by Siao

"be smart, drink your wine"

Link to comment
Share on other sites

Thanks guys. I guess I really shouldnt be programing at 3:32 am Should I lol? Im so tired I cant see straight lol. I normally wouldnt make such a dumb mastake.

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

  • 2 weeks later...

Thanks guys. I guess I really shouldnt be programing at 3:32 am Should I lol? Im so tired I cant see straight lol. I normally wouldnt make such a dumb mastake.

Been looking for how to set the colour of the window for a while thanks for the information. This is how I used it. My routine also allows the menu to be moved and the new position saved.

Cheers Ant..

CODE
#include<GUIConstants.au3>

Global $MenuAPos1 = IniRead(@ScriptDir & "\demo.ini", "section23", "value1", "-1")

Global $MenuAPos2 = IniRead(@ScriptDir & "\demo.ini", "section23", "value2", "-1")

Dim $pTitle = "Example"

Global $xPos, $yPos

While 1

GUICreate($pTitle, 265, 280, $MenuAPos1, $MenuAPos2)

WinSetTrans($pTitle, "", 255)

GUISetBkColor(0xffff99, $pTitle)

$ExitButton = GUICtrlCreateIcon("shell32.dll", 240, 215, 236, 35, 40)

GUICtrlSetTip(-1, " Exit", "Help", 1, 1)

GUISetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE Or $msg = $ExitButton

GUIDelete()

Exit

Case $msg = $GUI_EVENT_PRIMARYDOWN

calculateWindowPos()

If $xPos <> $MenuAPos1 Or $yPos <> $MenuAPos2 Then

GUIDelete()

$section = "section23"

$value1 = $xPos

$value2 = $yPos

SaveChanges()

ExitLoop

EndIf

EndSelect

WEnd

WEnd

;Calculate the position of the active Window

Func calculateWindowPos()

$wp = WinGetPos($pTitle)

$xPos = $wp[0]

$yPos = $wp[1]

EndFunc ;==>calculateWindowPos

;Save Changes

Func SaveChanges()

If $value1 >= 0 Then

IniWrite(@ScriptDir & "\demo.ini", $section, "value1", $value1)

EndIf

If $value2 >= 0 Then

IniWrite(@ScriptDir & "\demo.ini", $section, "value2", $value2)

EndIf

;Read MenuA Position

Global $MenuAPos1 = IniRead(@ScriptDir & "\demo.ini", "section23", "value1", "-1")

Global $MenuAPos2 = IniRead(@ScriptDir & "\demo.ini", "section23", "value2", "-1")

EndFunc ;==>SaveChanges

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