Click here to Skip to main content
15,887,746 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: problem Pin
Richard MacCutchan12-Oct-10 22:38
mveRichard MacCutchan12-Oct-10 22:38 
AnswerRe: problem [modified] Pin
Alain Rist13-Oct-10 4:52
Alain Rist13-Oct-10 4:52 
QuestionFire connection point event from ATL Service Pin
pratik_mishra3511-Oct-10 2:17
pratik_mishra3511-Oct-10 2:17 
Questionhow show the tooltip in each platform(vb,c#) Pin
765studio@gmail.com8-Oct-10 20:35
765studio@gmail.com8-Oct-10 20:35 
QuestionProblems to print Pin
Dansveen7-Oct-10 11:42
Dansveen7-Oct-10 11:42 
QuestionWhy normal virtual function required blank body in base class Pin
am 20096-Oct-10 2:22
am 20096-Oct-10 2:22 
AnswerRe: Why normal virtual function required blank body in base class Pin
Alain Rist6-Oct-10 3:13
Alain Rist6-Oct-10 3:13 
QuestionEnable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo5-Oct-10 6:58
karuuzo5-Oct-10 6:58 
Hi all!

Sorry for my english, I use it very rarely and have bad grammer Sniff | :^)


I tired to get moving marquee progress bar in my project. I read many articles, try different variants, but nothing work. Progress bar freezes in left side and only, what I can do, change it size, by varying range.

All, wat I do:
1. add refference into manifest file for common controls:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
	<assemblyIdentity 
    version="1.0.0.0" 
    processorArchitecture="X86" 
    name="XPProgress" 
    type="win32" />
	<description>XPProgress</description>
	<dependency>
		<dependentAssembly>
			<assemblyIdentity 
        type="win32" 
        name="Microsoft.Windows.Common-Controls" 
        version="6.0.0.0" 
        processorArchitecture="X86" 
        publicKeyToken="6595b64144ccf1df" 
        language="*" />
		</dependentAssembly>
	</dependency>
</assembly>


2. change supported windows versions:
#define _WIN32_WINDOWS 0x0501


3. enable common controls:
::AtlInitCommonControls (ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_PROGRESS_CLASS);


4. create simple dialog with progress bar:
IDD_DIALOG DIALOGEX 0, 0, 331, 44
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,137,23,50,14
    CONTROL         "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7,7,317,14
END


5. create dialog class:
class CDlgMain : public  CDialogImpl<CDlgMain>
{
public:
	enum { IDD = IDD_DIALOG };

	CDlgMain(void);
	~CDlgMain(void);

	BEGIN_MSG_MAP(CDlgMain)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_CLOSE, OnClose)
		COMMAND_ID_HANDLER(IDOK, OnOK)
	END_MSG_MAP()


	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

};


6. on button click - enable/disable marquee option for toolbar:
LRESULT CDlgMain::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	DWORD dwWinLong = ::GetWindowLong(GetDlgItem (IDC_PROGRESS), GWL_STYLE);

	if (dwWinLong & PBS_MARQUEE)
	{
		::SetWindowLong(GetDlgItem (IDC_PROGRESS), GWL_STYLE, dwWinLong & (~PBS_MARQUEE));
		::SendMessage(GetDlgItem (IDC_PROGRESS), PBM_SETMARQUEE, (WPARAM) 0, (LPARAM) 100);
	}
	else
	{
		::SetWindowLong(GetDlgItem (IDC_PROGRESS), GWL_STYLE, dwWinLong | PBS_MARQUEE); 
		::SendMessage(GetDlgItem (IDC_PROGRESS), PBM_SETMARQUEE, (WPARAM) 1, (LPARAM) 100);
	}
	return TRUE;
}


Result is freezed progress bar, that not moving anywhere Frown | :(
I discovered, than, when I change progress bar range to smaller values, visible progress line grow biger, but nowhere moves.
::SendMessage(GetDlgItem (IDC_PROGRESS), PBM_SETRANGE, 0, MAKELPARAM(0, 20));


Someone can tell me, what I do wrong, or what I miss? I read many articles in different sites and forums, but there say, that is enough to enable progress bar animation.
karuuzo

AnswerRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist5-Oct-10 21:16
Alain Rist5-Oct-10 21:16 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 1:13
karuuzo6-Oct-10 1:13 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist6-Oct-10 2:09
Alain Rist6-Oct-10 2:09 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 3:48
karuuzo6-Oct-10 3:48 
AnswerRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist6-Oct-10 4:19
Alain Rist6-Oct-10 4:19 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 5:14
karuuzo6-Oct-10 5:14 
AnswerRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Alain Rist6-Oct-10 5:23
Alain Rist6-Oct-10 5:23 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Richard MacCutchan6-Oct-10 4:03
mveRichard MacCutchan6-Oct-10 4:03 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 4:12
karuuzo6-Oct-10 4:12 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
Richard MacCutchan6-Oct-10 5:02
mveRichard MacCutchan6-Oct-10 5:02 
GeneralRe: Enable moving marquee progress bar (C++, ATL/WTL, XP, VS2008) Pin
karuuzo6-Oct-10 5:23
karuuzo6-Oct-10 5:23 
QuestionRegarding Tools Pin
Anil Kumar.Arvapalli3-Oct-10 21:16
Anil Kumar.Arvapalli3-Oct-10 21:16 
AnswerRe: Regarding Tools Pin
LunaticFringe4-Oct-10 12:28
LunaticFringe4-Oct-10 12:28 
AnswerRe: Regarding Tools Pin
federico.strati5-Oct-10 3:19
federico.strati5-Oct-10 3:19 
QuestionDynamic Owner-Drawn CListBox Derivative - Owner Draw Problem Pin
Kyudos3-Oct-10 13:00
Kyudos3-Oct-10 13:00 
AnswerRe: Dynamic Owner-Drawn CListBox Derivative - Owner Draw Problem Pin
Kyudos3-Oct-10 17:24
Kyudos3-Oct-10 17:24 
QuestionCustomize CMFCPropertyGrid Pin
silversamand1-Oct-10 21:37
silversamand1-Oct-10 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.