AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Color-Code Windows
PostPosted: March 4th, 2010, 2:13 pm 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 4:07 pm 
Offline

Joined: January 28th, 2008, 9:40 pm
Posts: 140
Location: KC
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2010, 4:27 pm 
Offline

Joined: November 14th, 2007, 2:47 pm
Posts: 335
Location: London, England
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. :lol:
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
               }
         }

   }


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 12:19 am 
Offline

Joined: January 28th, 2008, 9:40 pm
Posts: 140
Location: KC
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2010, 6:05 am 
Offline

Joined: January 3rd, 2010, 6:33 am
Posts: 262
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.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Bing [Bot], rbrtryn and 66 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