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 

Color-Code Windows

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



Joined: 14 Nov 2007
Posts: 325
Location: London, England

PostPosted: Thu Mar 04, 2010 1:13 pm    Post subject: Color-Code Windows Reply with quote

Hi Guys,

Here is what I would like to achieve:

I have 4 windows, of the same type and class. What I would like to do is give them each a colored border. (Red, Yellow, Blue Green)

Is this possible?
Back to top
View user's profile Send private message Visit poster's website
Neverlevel



Joined: 28 Jan 2008
Posts: 138
Location: KC

PostPosted: Thu Mar 04, 2010 3:07 pm    Post subject: Reply with quote

you have 4 GUI windows or windows from a different program? are the windows at a fixed location? an example of the code you want a border added to?
_________________
The early bird gets the worm but the second rat gets the cheese!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
doyle



Joined: 14 Nov 2007
Posts: 325
Location: London, England

PostPosted: Thu Mar 04, 2010 3:27 pm    Post subject: Reply with quote

Its part of another script that detects new instances of windows, and then moves them into a specific location.

They are currently Notepad windows while I test it, as they load quickly.

Ideally, it would detect when a new window is created, and then assign it a color.

It could be a border, or i guess it could change the color of the title bar?

Once I work out how to do the border, i think the rest of it will be within my skill, I just dont know how to do the border. Laughing
Code:
SetBatchLines, -1
Process, Priority,, High

Gui +LastFound
hWnd := WinExist()

DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )

win = 0
Return

ShellMessage( wParam,lParam )
   {
      Global
      If ( wParam = 1 ) ;  HSHELL_WINDOWCREATED := 1
         {
            WinGetClass, new_class, ahk_id %lParam%
            If  ( new_class = "Notepad" )
               {
                  ;MsgBox, A new notepad window was opened.
                  time%lParam% := A_TickCount
               }
         }

   }
Back to top
View user's profile Send private message Visit poster's website
Neverlevel



Joined: 28 Jan 2008
Posts: 138
Location: KC

PostPosted: Thu Mar 04, 2010 11:19 pm    Post subject: Reply with quote

if you could retrieve the location the window moves to as well as its height and width.........


Code:


bDimh = 22 ; Change this to desired size.
bDimw = 22
Gui, -Caption Border AlwaysOnTop ToolWindow
Gui, Color, C0C0C0
Gui, Show, NA W%bDimh% H%bDimw% X%xPos% Y%yPos%, hitBox

WinWait, hitBox



should draw a box around it...just put those values into bDimh, bDimw, xPos, and yPos


oh and change the color
_________________
The early bird gets the worm but the second rat gets the cheese!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
jl34567



Joined: 03 Jan 2010
Posts: 262

PostPosted: Fri Mar 05, 2010 5:05 am    Post subject: Reply with quote

See posts by Shimanov.....in following post:
http://www.autohotkey.com/forum/topic5206.html

What poker site are you building this for?

It can be adapted for windows instead of drag boxes.
Back to top
View user's profile Send private message AIM Address
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