c++ - PBM_SETMARQUEE是否不适用于垂直过程栏?

标签 c++ winapi mfc win32gui

我已经在这个问题上进行了大量搜索和测试,但仍然无法获得PBM_SETMARQUEE的垂直过程栏的支持。它始终向我显示完全绿色填充的过程栏,但从底部到顶部没有移动的绿色“矩形”。不知何故,如果我删除PBS_VERTICAL样式,那么我得到的水平处理栏带有从左到右移动的绿色“矩形”。因此,意味着PBM_SETMARQUEE适用于水平处理栏,但不适用于垂直处理栏。我还想出的一点是,如果禁用windowtheme样式对于过程栏,PBM_SETMARQUEE突然可以运行O_o!?(但没有windowstheme颜色和动画)
这是代码的必需部分(使用c++和winapi):

//includes especially for the processbar
#include <CommCtrl.h>  
#include <Uxtheme.h>
#pragma comment( lib, "comctl32.lib")
#pragma comment( lib, "UxTheme.lib")
#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

//code how i creat the processbar
INITCOMMONCONTROLSEX initCtrlEx;
initCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
initCtrlEx.dwICC = ICC_PROGRESS_CLASS;
if (InitCommonControlsEx(&initCtrlEx)){     
    hProcessBar = CreateWindowExA(
        NULL,
        PROGRESS_CLASSA,
        "",
        WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | PBS_VERTICAL,                                         
        10, 10,
        20, 250,
        hParent,
        (HMENU)id,
        hProgrammInstance,
        NULL
        );
}

//SetWindowTheme(hProcessBar, L"", L""); If i use this code then the  PBM_SETMARQUEE for vertical processbar works.. but cause i want the windowTheme style its not a good solution for me
DWORD style = GetWindowLongPtrA(hProcessBar, GWL_STYLE);
SetWindowLongPtrA(hProcessBar, GWL_STYLE, style | PBS_MARQUEE); //enable needed style for the  PBM_SETMARQUEE message. (i also tested it doing it directly in CreateWindowExA())
SendMessageA(hProcessBar, PBM_SETMARQUEE, TRUE, (LPARAM)30);//enable marquee mode

最佳答案

没什么可说的了。 Microsoft没有实现垂直主题的字幕框进度条。大概他们觉得对他们没有需求。

关于c++ - PBM_SETMARQUEE是否不适用于垂直过程栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30135497/

相关文章:

c# - 用于序列化 C++ 和反序列化为 C# 类的 Protocol Buffer

windows - QueryWorkingSet 在其结果中包含无效页面

python - 在 Win32 上为 Python 2.6 编译 MySQLdb 时出现问题

c++ - 如何在 Windows Mobile 的 MFC 对话框中更改字体/颜色?

c++ - 0.1 float 大于 0.1 double。我以为是假的

c++ - 父类对象的动态数组,用于保存子对象

C - PlaySound() 在将位置作为 char[] 传递时找不到文件

c++ - ANSI 项目中的 SetWindowTextW

c++ - MFC限制ClistCtrl中的选中项

c++ - 如何使用合并排序计算大量输入的反转次数