SetMarquee 函数不适用于 C++ 中的多字节字符集

The SetMarquee function is not working on MultiByte Character Set in C++

我在我的项目中使用多字节字符集。

当字符集为多字节时,SetMarquee 函数不允许访问。

以下函数在 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxcmn2.inl

#if defined(UNICODE)
_AFXCMN_INLINE BOOL CProgressCtrl::SetMarquee(_In_ BOOL fMarqueeMode, _In_ int nInterval)
{ ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, PBM_SETMARQUEE, (WPARAM)fMarqueeMode, (LPARAM)nInterval); }
#endif  // defined(UNICODE)

我正在尝试在我的代码中使用下面的 SendMessage 函数来实现 Marquee 样式。但它不起作用。

::SendMessage(m_hWnd, PBM_SETMARQUEE, (WPARAM)TRUE, (LPARAM)1);

你能帮我解决这个问题吗?

谢谢! 维杰·昆巴尼

找到答案。

我需要创建 CProgressCtrl

的 class 对象
CProgressCtrl progressCtrl;
LRESULT lResult = ::SendMessage(progressCtrl, PBM_SETMARQUEE, (WPARAM)TRUE, (LPARAM)1);

您需要将 Progress Ctrl 对象作为 HANDLE 传递给 SendMessage 函数。