Open Side Menu Go to the Top
Register
HELP - Change windows title with AHK HELP - Change windows title with AHK

04-10-2011 , 11:47 PM
I found a script on Autohotkey forum on how to change windows titles, it is something like this (i just cutted the part i needed):

Code:
F2::GoSub, GetTitle
Return

GetTitle:
WinID := WinExist("A")
WinGetTitle, CTitle, ahk_id %WinID%
If CTitle=Program Manager
Exit

WinSetTitle, ahk_id %WinID%,, Diamondbet - %CTitle%



Return
I want to add the word "Diamondbet" before the title on all the ahk_class GFX_INT_DLG_WINDOW_GAME windows that don't have it already.

Now i have to hit F2 on top of every window to this to work and it works just fine but i want this to work automatic if possible.


Can someone help?

TY
HELP - Change windows title with AHK Quote
04-11-2011 , 09:42 AM
Let me know how this works out for you.

Code:
	  classname	:= "GFX_INT_DLG_WINDOW_GAME"
	, addstring	:= "Diamondbet"
	, a 		:= 0
return

; Enable / disable custom title timer with this hotkey
f2::
	a := !a
	; Use a timer with 1000ms running cycle
	settimer, settitle, % a ? 1000 : "off"
Return

settitle:
	loop
	{
		; If a window of GFX_INT_DLG_WINDOW_GAME class exists and has not yet been added a custom title
		if winexist("ahk_class " classname, "", addstring)
		{
			wingettitle, title
			; Apply the new title as "Diamondbet - original_title"
			winsettitle, , , % addstring " - " title
		}
		; No more matching windows -> break out of the loop
		else
			break
	}
Return
HELP - Change windows title with AHK Quote
04-11-2011 , 02:05 PM
I actually have done one myself (i just merged to diferent scritpts) with the help of the guys from autohotkey forum. I should just bumped this with that info, but since no one reply i though this was already dead, sorry for the work.

But tks, yours have the hotkey to disable wich is a bonus.


Code:
#SingleInstance Force
#Persistent

SetTimer IrfanView, 100
Return

IrfanView:
   WinGet IDs, List, ahk_class GFX_INT_DLG_WINDOW_GAME

   Loop %IDs%
   {
      ID := IDs%A_Index%
      If ID not in %Old_IDs%
      {
         WinWait ahk_id %ID%
	 GoSub, GetTitle
         
      }
      New_IDs .= ID ","
   }
   StringTrimRight Old_IDs, New_IDs, 1
   New_IDs =




Return


GetTitle:
WinID := WinExist("A")
WinGetTitle, CTitle, ahk_id %WinID%
If CTitle=Program Manager
Exit

WinSetTitle, ahk_id %WinID%,, Diamondbet - %CTitle%, Diamondbet
HELP - Change windows title with AHK Quote

      
m