Jump to content
Sign in to follow this  

Change Color of TitleBar for one *SINGLE* Application?

Recommended Posts



I'm looking for an option, to make two instances of the *SAME* program distinguishable from each other. They simply are started from different folders. I wanted to change the Title Text, but I can't do this, as it breaks functions within the EXE (details below).

So I thought, if there might be a solution, to change the title bar *COLOR* for that window (and *ONLY* for _THAT_ window, like it's well known from Office 2010, when the message shows up: "Your copy has not been registered". blah blah" : Yellow to red task bar in stead of dark blue to light blue.)

Any other suggestion, to make two instances of the same programms bullet proof distinguishable are mostly appreciated.

Thanks, Rudi.

Details & Facts:

This is a Lab, using one single certain EXE file for serveral purposes, a Delphi program. This Lab has several divisions (?), they all use this very same EXE (plus other files around it) to do their work.

The EXE (and other files it needs) are simply stored in separate folders, e.g.




The "test.exe" is checking, from which folder it was started. Dependant on that, it adjusts title text and taskbar button text.

Unfortunately the "startup folders", "title bar text" and the "taskbar button text" are hardcoded in the EXE file, and when I modify them, the program doesn't work any more: It's dependent to find "current title bar text" in it's own list of the four "known" ones.

The programmer of that EXE is a friend of mine, it was coded some 12 years ago, absolutely outdated Delphi Version, and he doesn't have the environment at hand, to do the (minor) changes required to get that new path + title into the EXE. (no comments upon this, please, it's simply fact)

This doesn't work, as it changes the title:

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_LegalCopyright=(c) 2012 by Rudolf Thilo, IT-Beratung Rudolf Thilo
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

$exe = "F:\Main-BG\Mainlan_.exe"
$path = "F:\Main-BG"
$title = "DeTox Center"
$Match = "M a i n l a n"
$PID = Run($exe, $path)
$hWnd = 0
$stPID = DllStructCreate("int")
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then ; Fenster hat Titeltext
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
    $hWnd = $winlist2[$i][1]
    If $winlist2[$i][0] = $Match Then
     $Result = WinSetTitle($hWnd, "", "DeTox Center")
Until $hWnd <> 0

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this