 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
HCProfessionals
Joined: 18 Jun 2007 Posts: 166
|
Posted: Sat Feb 27, 2010 8:14 pm Post subject: Winset Transparency Color |
|
|
the transparency is white, anyway to change the color to a custom hex code?
| Code: |
WinGetPos, , , Width, Height, ahk_class Progman
SplashTextOn, %Width%, %Height%, Lock SCREEN
WinSet, Transparent, 250, Lock SCREEN
|
|
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
|
| Back to top |
|
 |
HCProfessionals
Joined: 18 Jun 2007 Posts: 166
|
Posted: Sat Feb 27, 2010 9:36 pm Post subject: |
|
|
I'm trying to keep the transparency, but white sucks, i like black better.
| Code: |
WinGetPos, , , Width, Height, ahk_class Progman
SplashTextOn, %Width%, %Height%, Lock SCREEN
WinSet, Transparent, 250, Lock SCREEN
WinSet, TransColor, 000000, Lock SCREEN ; Something like this
|
|
|
| Back to top |
|
 |
HCProfessionals
Joined: 18 Jun 2007 Posts: 166
|
Posted: Sun Feb 28, 2010 3:11 pm Post subject: |
|
|
| Is this possible? |
|
| Back to top |
|
 |
closed
Joined: 07 Feb 2008 Posts: 509
|
Posted: Sun Feb 28, 2010 5:47 pm Post subject: |
|
|
You can use gdi instead.You need the gdip.ahk library in the same dir or in your autohotkey lib dir.
http://www.autohotkey.net/~tic/Gdip.ahk
and i take this occasion to thank tic for his excellent work 
| Code: |
#SingleInstance, Force
#NoEnv
SetBatchLines, -1
; Uncomment if Gdip.ahk is not in your standard library
#Include, Gdip.ahk
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
Width := A_ScreenWidth, Height := A_ScreenHeight
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Show, NA
hwnd1 := WinExist()
hbm := CreateDIBSection(Width, Height)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)
pBrush := Gdip_BrushCreateSolid(0x04000000)
Gdip_FillRectangle(G, pBrush, 0, 0, Width, Height)
Gdip_DeleteBrush(pBrush)
Font = Arial
If !Gdip_FontFamilyCreate(Font)
{
MsgBox, 48, Font error!, The font you have specified does not exist on the system
ExitApp
}
Options = x10p y30p w80p Centre cbb000000 r4 s50 Underline Italic
Gdip_TextToGraphics(G, "Screen Locked click to end", Options, Font, Width, Height)
UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth-Width)//2, (A_ScreenHeight-Height)//2, Width, Height)
OnMessage(0x201, "WM_LBUTTONDOWN")
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Return
WM_LBUTTONDOWN()
{
msgbox,262148,, escape lock?
IfMsgBox yes
gosub Exit
}
!Esc::
gosub Exit
Exit:
Gdip_Shutdown(pToken)
MsgBox,,, bye bye,2
ExitApp
Return |
|
|
| Back to top |
|
 |
HCProfessionals
Joined: 18 Jun 2007 Posts: 166
|
Posted: Sun Feb 28, 2010 8:38 pm Post subject: |
|
|
| Thank you for that, but I am not looking to change font color, I am looking to primarily change the color of the white background in the code I gave above. |
|
| Back to top |
|
 |
closed
Joined: 07 Feb 2008 Posts: 509
|
Posted: Mon Mar 01, 2010 9:39 am Post subject: |
|
|
| Quote: | | am looking to primarily change the color of the white background |
With gdi it is the brush parameters that give you the transparency/color (0x04000000) is black(000000) and transparency set to 04.
The advantage is that you can have text that is unaffected by the transparency of the background.
or you could use splashimage (without image),there you have the colour settings see helpfile for all parameters.
| Code: | WinGetPos, , , Width, Height, ahk_class Progman
Splashimage,,b w%width% h%height% CW000000 ,,,lock screen
WinSet, transparent,200,lock screen
sleep 10000
SplashImage, off
return |
Your code for width and height does not cover the whole screen,you could use A_ScreenWidth and A_ScreenHeight if needed. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|