Windows – Change the Title Bar of a Windows Executable

visual-c++windows

Iam creating an application like resource hacker. I want to change the title bar text of a window whose handle I can find out using SPY++.

Is there any way I can make modifications to the resources of the assembly and change the title by my code, so that the change is permanent.

Are there are tools free or commercial like my program? which can change the title bar text of a windows executable and assemble it back.

Iam open to suggestions.

Iam using VC++ to code my application.

Best Solution

My browser currently has in its title bar "Change the Title Bar of a Windows Executable - Stack OVerflow - Opera". Please explain how that you could fix that via a resource.

Now, this is in fact possible, but not via a resource. You need to create a DLL that sets the caption, and intercepts any attempt to set it. Changing the caption is done by sending WM_SETTEXT to the HWND. Hence, your DLL will need to hook the WndProc for the main window class and discard WM_SETTEXT messages.

The next step is to add your DLL to the list of DLL dependencies of the EXE. You need to add your DLL to the IAT, but you don't need to import anything. The format is well described by Matt Pietrek in An In-Depth Look into the Win32 Portable Executable File Format