Changing progress bars in win32....

This is a discussion on Changing progress bars in win32.... within the Windows Programming forums, part of the Platform Specific Boards category; how do i modify a progress bar so that I can make it actually SHOW the progress? Is there a ...

  1. #1
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903

    Changing progress bars in win32....

    how do i modify a progress bar so that I can make it actually SHOW the progress? Is there a SetAttributes command or something that I can use for setting that? I don't have any code to show......so if anyone just knows the command, thanks

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> how do i modify a progress bar so that I can make it actually SHOW the progress?

    Eh? What do you mean? A progress bar control just show the information you give it. You send it a PBM_SETRANGE message to set it's range, (default is 0-100), a PBM_SETSTEP to set it's step size, (default is 10), PBM_STEPIT to advance it by a step, or PBM_SETPOS to set it's position.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    what command/function do i use to do that though?

    ok, nevermind that, i found the SendMessage command, but how do i get a handle to a dialog box if i'm just using this command to make one:

    DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_PROGRESS), hwnd, ProgressDlgProc);

    ............
    Last edited by jverkoey; 04-27-2003 at 12:35 AM.

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    If the progress bar is on a dialog box, then you can get it's handle by calling GetDlgItem(), using the handle of the dialog box that was passed to your dialog function, and the integer ID of the progress control.

    Alternatively, you could use the SendDlgItemMessage() rather than SendMessage().

    Look these up in the help.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    i also have another problem....i fixed the progress bar thing on my own (i just looked on msdn and learned that it was easier to just create a progress bar window).....but now the thing is, the program.....well, look for youself

    when I try to look at the about part, the program freezes up and i have to ctrl-alt-delete it, but if i load a picture before i look at it, it doesn't freeze up and the help file dialog loads up fine.....

    you can download the current version here from this post

    oh yah, and here's the code i use to call up the help file

    Code:
    case ID_HELP_ABOUT:
    	DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), hwnd, AboutDlgProc);
    	break;
    -edit-
    and also, it seems as soon as i press a button, it comes up......
    Attached Files Attached Files
    Last edited by jverkoey; 04-27-2003 at 02:33 AM.

  6. #6
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    well, this one does that key thing i said above ^^^

    other one is old

    -edit-
    ok, nevermind, i keep answering my own questions....lol. I just looked around in the header file and found the CreateDialog command that actually returned a handle (HWND). I then took that returned handle and used it to show the dialog box (because I figured it WASN'T being shown for some reason)

    but anyways, here was my solution:

    Code:
    case ID_HELP_ABOUT:
    	{
    		HWND hDiagBox=CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUT), hwnd, AboutDlgProc);
    		ShowWindow(hDiagBox, numcmd);
    		UpdateWindow(hDiagBox);
    	}
    	break;
    Attached Files Attached Files
    Last edited by jverkoey; 04-27-2003 at 02:42 AM.

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    >>> i keep answering my own questions....

    Good. Once you have learnt to solve your own problems, then you'll be ready to solve your customers problems.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Progress bars in XP
    By Hunter2 in forum Windows Programming
    Replies: 2
    Last Post: 09-27-2003, 11:47 AM
  2. progress bars with Win32 API
    By bennyandthejets in forum C++ Programming
    Replies: 15
    Last Post: 09-10-2002, 04:25 AM
  3. Progress Bars
    By knight543 in forum Windows Programming
    Replies: 1
    Last Post: 08-21-2002, 10:45 AM
  4. Win32 child window split bars
    By S in forum Windows Programming
    Replies: 1
    Last Post: 02-25-2002, 02:42 AM
  5. Progress bars... HELP!!!
    By Prog.Patterson in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2002, 11:00 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21