2015-05-09 70 views
1

我在这个问题上已经搜索和测试了很多时间,而且我仍然无法获得PBM_SETMARQUEE用于垂直处理工作。它总是向我展示一个完全绿色填充的工艺栏,但从底部到顶部没有移动的绿色“矩形”。不知何故,如果我删除了PBS_VERTICAL风格,那么我得到一个水平的工艺栏,从左到右移动一个绿色的“矩形”,这意味着PBM_SETMARQUEE适用于水平工作栏,但不适用于垂直工作栏,我也想到了如果我禁用windowtheme风格对于processbar的PBM_SETMARQUEE突然作品O_O!?(但没有windowstheme颜色和动画) 这里是(使用C++和WINAPI)的代码所需要的部分。PBM_SETMARQUEE不适用于垂直进程条?

//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 

回答

1

没有太多可说的了微软没有实现垂直主题选取框进度条。大概他们觉得没有对它们的需求。

+0

Thx为你的答案大卫.XD和总是像...一些亲的爱好似乎是一直downvote新手问题^^ ...他们从不留下评论为什么他们低估了这个问题^^所以我怎么能知道我做错了,如果没有人说O_o!? ......当然,在问这里一个问题之前,我会做一些研究^^或者我怎么知道前例。 SetWindowTheme(hProcessBar,L“”,L“”);可以解决它(但不是我需要的方式)? – Bluefire