Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[vc++ help] win32 progress bar problems

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Tue May 06, 2008 6:06 pm    Post subject: [vc++ help] win32 progress bar problems Reply with quote

hi

im having trouble setting up win 32 progress control in my dialog. it doesn't show progress bar even though i tried to setstep and stepit

any one know whats wrong?

here is what i did

Code:


 HWND pHP;
 InitCommonControls();

pHP = CreateWindowEx(0, PROGRESS_CLASS, NULL,
             WS_CHILD | WS_VISIBLE,
             20, 20, 200, 20,
             hWnd, NULL, GetModuleHandle(NULL), NULL);

 
//progress bar init
SendMessage(pHP, PBM_SETBARCOLOR, 0,  (LPARAM)RGB(255,0,0));
 SendMessage(pHP,PBM_SETRANGE,0,(LPARAM)(0,10));   
SendMessage(pHP, PBM_SETSTEP, (WPARAM) 1, 0);
//-----------start-------------------------
SendMessage(pHP, PBM_STEPIT, 5, 0);




thank you again

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Tue May 06, 2008 6:21 pm    Post subject: Reply with quote

try

Code:
INITCOMMONCONTROLSEX init;
init.dwSize = sizeof(INITCOMMONCONTROLSEX);
init.dwICC = ICC_PROGRESS_CLASS;
InitCommonControlsEx(&init);


Instead of just InitCommonControls();

Edit:
Btw, you can't use InitCommonControls cuz it doesnt have any affect Wink

Taken from: http://msdn.microsoft.com/en-us/library/bb775695(VS.85).aspx
Quote:
Remarks

Under Comctl32.dll version 5.x, only Microsoft Windows 95 classes (ICC_WIN95_CLASSES) can be registered through InitCommonControls. Programs which require additional common control classes must use the InitCommonControlsEx function.

Under Comctl32.dll version 6.0 and later, InitCommonControls does nothing. Applications must explicitly register all common controls through InitCommonControlsEx.

_________________
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Tue May 06, 2008 9:56 pm    Post subject: Reply with quote

ty lurc

after trying, the progress bar was still not activated(blank rectangle). maybe im missing something important to get the progress bar?

Code:


 HWND pHP;

INITCOMMONCONTROLSEX init;
init.dwSize = sizeof(INITCOMMONCONTROLSEX);
init.dwICC = ICC_PROGRESS_CLASS;
InitCommonControlsEx(&init);

pHP = CreateWindowEx(0, PROGRESS_CLASS, NULL,
             WS_CHILD | WS_VISIBLE,
             20, 20, 200, 20,
             hWnd, NULL, GetModuleHandle(NULL), NULL);

 
//progress bar init
SendMessage(pHP, PBM_SETBARCOLOR, 0,  (LPARAM)RGB(255,0,0));
 SendMessage(pHP,PBM_SETRANGE,0,(LPARAM)(0,10));   
SendMessage(pHP, PBM_SETSTEP, (WPARAM) 1, 0);
//-----------start-------------------------
SendMessage(pHP, PBM_STEPIT, 5, 0);



_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Wed May 07, 2008 12:33 am    Post subject: Reply with quote

I wrote a quick example showing how to step a progressbar via a thread, attached to this post. Refresh if you can't see it.


The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed May 07, 2008 1:40 pm    Post subject: Reply with quote

ty so much wiccan
you have always been helpful to me Razz

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Thu May 08, 2008 6:57 am    Post subject: Reply with quote

Bizarro wrote:
ty so much wiccan
you have always been helpful to me Razz


Not a problem. Glad it could help ya. Smile

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites