Vijay Kumbhani
Vijay Kumbhani

Reputation: 742

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

I am using Multibyte Character Set on my project.

The SetMarquee function is not allowed to access while the character set is MultiByte.

The below function available in 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)

I am trying to using below SendMessage function for Marquee style on my code. but it is not working.

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

Could you please help me on this issue.

Thanks! Vijay Kumbhani

Upvotes: -1

Views: 669

Answers (1)

Vijay Kumbhani
Vijay Kumbhani

Reputation: 742

Found the answer.

I need to create a class object of CProgressCtrl

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

You need to pass Progress Ctrl object as HANDLE on SendMessage function.

Upvotes: 0

Related Questions