Windows 如何在任务栏上设置WindowText?

Windows 如何在任务栏上设置WindowText?,windows,winapi,Windows,Winapi,这会将标题栏设置为“新标题”,但任务栏中的标题仍然是“旧标题”。如何设置两者 如果相关,这是在拥有窗口的进程中加载的DLL中完成的。这应该同时设置窗口标题和任务栏项。你的电话 const char* title = "old title"; HWND hwnd = FindWindow(title, title); SetWindowText(hwnd, "new title"); 看起来不太好,第一个参数必须是类名(请看)。在我看来,问题出在别的地方,但我可能错了 HWND hwnd = F

这会将标题栏设置为“新标题”,但任务栏中的标题仍然是“旧标题”。如何设置两者


如果相关,这是在拥有窗口的进程中加载的DLL中完成的。

这应该同时设置窗口标题和任务栏项。你的电话

const char* title = "old title";
HWND hwnd = FindWindow(title, title);
SetWindowText(hwnd, "new title");
看起来不太好,第一个参数必须是类名(请看)。在我看来,问题出在别的地方,但我可能错了

HWND hwnd = FindWindow(title, title);