Does anyone know how to integrate Status bars in a program that will show just how much has been saved, as in Microsoft Word or any Microsoft Product?
Does anyone know how to integrate Status bars in a program that will show just how much has been saved, as in Microsoft Word or any Microsoft Product?
How much do you know about the progress of the save?
eg are you writting by each record in the file one at a time for a number of records?
if the dialog containing the progress bar has the HWND hWndPB and the progressbar has ID IDC_PROGRESS then;
Code://set it back to start SendMessage(GetDlgItem(hwndPB,IDC_PROGRESS), PBM_SETPOS, (WPARAM) 0,(LPARAM)0); //set the range TotalSteps=100; SendMessage(GetDlgItem(hwndPB,IDC_PROGRESS), PBM_SETRANGE, (WPARAM) 0,(LPARAM)MAKELPARAM(0,TotalSteps)); //set each step to one SendMessage(GetDlgItem(hwndPB,IDC_PROGRESS), PBM_SETSTEP, (WPARAM) 1, 0); //this will step it once SendMessage(GetDlgItem(hwndPB ,IDC_PROGRESS ), PBM_STEPIT, (WPARAM) 0, 0);
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
sorry for the delay of my answer. I know this much, when a program saves, it loads a progress bar, and when it is just about finished, the progress bar is just about to the end. What I would like to do, is have a progress bar define for the user approximately how much time is left for the file to be sent via TCP/IP to another computer while being saved and printed at two different other computers. If you could please help, I would appreciate it.
~Brett Patterson
"Some succeed because they are destined to, others succeed because they are determined to."
~Anonymous
"A shorn scrotum is quite breathtaking, I suggest you try it."
~Dr. Evil
EMT/Firefighter
Eagle Scout
So you are sending a file thru a socket?
You can get the file size if you have a HANDLE to it with GetFileSize(). As it is written to the socket in smallish amounts, depending on the buffer size you have set in setsockopt(). Each write can be timed using GetTickCount() and so by percentage the total time calculated.
Use the above lines to set the progressbar steps and create a static ctrl to display the time, remember to UpdateWindow() after changing the text to display the new text on screen.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
Thanks for all of your help. I'll try that soon and will be back to inform you of my success. Hopefully all goes well. It could be a while because I have actually lost my entire program. My computer was in a fire, so if you would please bear with me as I try and regain what I have lost over the next few weeks. Thanks a lot though. Just in case you are wondering, I have a desktop and a laptop, my laptop is what is gone.
~Prog.Patterson
"Some succeed because they are destined to, others succeed because they are determined to."
~Anonymous
"A shorn scrotum is quite breathtaking, I suggest you try it."
~Dr. Evil
EMT/Firefighter
Eagle Scout