AutoHotkey Community

It is currently May 27th, 2012, 4:30 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: February 27th, 2010, 9:14 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 9:57 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2010, 10:36 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2010, 4:11 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
Is this possible?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2010, 6:47 pm 
Offline

Joined: February 7th, 2008, 9:48 pm
Posts: 509
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2010, 9:38 pm 
Offline

Joined: June 19th, 2007, 12:04 am
Posts: 174
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 1st, 2010, 10:39 am 
Offline

Joined: February 7th, 2008, 9:48 pm
Posts: 509
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Mickers, rbrtryn and 65 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group