AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Winset Transparency Color

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Sat Feb 27, 2010 8:14 pm    Post subject: Winset Transparency Color Reply with quote

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
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Sat Feb 27, 2010 8:57 pm    Post subject: Reply with quote

you are using the command wrong,
don't use Transparent
use TransColor:

http://www.autohotkey.com/docs/commands/WinSet.htm

>>TransColor is often used to create on-screen displays and other visual effects.
There is an example of an on-screen display at the bottom of the Gui page.
Arrow http://www.autohotkey.com/docs/commands/Gui.htm#OSD
Back to top
View user's profile Send private message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Sat Feb 27, 2010 9:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Sun Feb 28, 2010 3:11 pm    Post subject: Reply with quote

Is this possible?
Back to top
View user's profile Send private message
closed



Joined: 07 Feb 2008
Posts: 509

PostPosted: Sun Feb 28, 2010 5:47 pm    Post subject: Reply with quote

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 SmileSmile

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
View user's profile Send private message
HCProfessionals



Joined: 18 Jun 2007
Posts: 166

PostPosted: Sun Feb 28, 2010 8:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
closed



Joined: 07 Feb 2008
Posts: 509

PostPosted: Mon Mar 01, 2010 9:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group