gpt4 book ai didi

创建两个以上的 StatusBar 部件

转载 作者:太空宇宙 更新时间:2023-11-04 02:41:49 27 4
gpt4 key购买 nike

我无法创建两个以上的 StatusBar 部分:

HWND hStatusBar = CreateWindowEx(0, STATUSCLASSNAME, "", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hWnd, 0, GetModuleHandle(NULL), NULL);

int arr[3] = {100, 100, -1};
SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM)arr);

这段代码应该创建三个部分,但它只创建了两个!我做错了什么?

最佳答案

来自SB_SETPARTS文档:

Each element specifies the position, in client coordinates, of the right edge of the corresponding part

您的前两个部分位于同一位置(即它们完全重叠),因此您只能看到其中一个。您需要为每个后续部分增加右边缘:

int arr[3] = { 100, 200, -1 };

关于创建两个以上的 StatusBar 部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31105815/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com