Sunday, February 13, 2011

How do I set WindowText on the Taskbar?

const char* title = "old title";
HWND hwnd = FindWindow(title, title);
SetWindowText(hwnd, "new title");

This sets the title bar to "new title", but the caption in the task bar is still "old title". How do I set both?

If relevant, this is being done in a DLL loaded in the process which owns the window.

  • This should set both, window title and task bar item. Your call

    HWND hwnd = FindWindow(title, title);
    

    does not look good, first parameter has to be class name (look at FindWindow). It looks to me that problem is somewhere else but I may be wrong.

0 comments:

Post a Comment