Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Progress bar (in delphi)

Posted on 2003-03-05
4
Medium Priority
?
470 Views
Last Modified: 2008-03-03
I have a point in my application where Im waiting on a remote server to do some calculations for me, and I need to provide some visual feeback on my client end.

what I want to do is similar to the File Search utility in windows (XP At least) where it displays a progress bar but it only shows 3 little "Blips" and these scroll from left to right then they loop arround and keep doing this over and over.  I have seen this in use in a few places so I assume I can do it in delphi some how, I just need to know how.

just to clarify, its not the same as making the position go from 0 -> 100 then starting again.  I will try and illustrate below

------------------     ------------------
|   ***          |     |       ***      |
------------------     ------------------

any ideas would be great !


(I only have 35 points to offer, If I had more i would offer them)
0
Comment
Question by:JayBinks
4 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 8078986
look in
http://www.torry.net/statusbars.htm

maybe you can find what you look for there
0
 
LVL 1

Author Comment

by:JayBinks
ID: 8084466
Once again,  I answer my own question : )

This relies on CommCtrl V6 (only in XP)
but I think it will work in other windows (but not the scrolling)

use this function

procedure TForm1.set_marquee(pBar: TProgressBar; bMarqueeOn : Boolean);
const
  PBS_MARQUEE = $08;
  PBM_SETMARQUEE = (WM_USER+10);
var
  style : Integer;
begin
   if bMarqueeOn then
   begin
      style := GetWindowLong(pBar.Handle, GWL_STYLE);
      style := style + PBS_MARQUEE;
      SetWindowLong(pBar.Handle, GWL_STYLE , style);
      SendMessage(pBar.Handle, PBM_SETMARQUEE, ord( bMarqueeOn ), 100);
   end
   else
   begin
      style := GetWindowLong(pBar.Handle, GWL_STYLE);
      style := style - PBS_MARQUEE;
      SetWindowLong(pBar.Handle, GWL_STYLE , style);
      SendMessage(pBar.Handle, PBM_SETMARQUEE, ord( bMarqueeOn ), 100);
   end;
end;

all you have to do is use a regular TProgressBar and call this function like
 
set_marquee(pbProgress, true);  to turn the scroll on
and
set_marquee(pbProgress, false);  to turn the scroll off


this only works on Win XP !!!
and you MUST have an XP Manifest in your application (XP theme support).  this is easy in Delphi 7 (Just add a TXPManifest), in other delphi versions I dont know how to do this.

hope this is some help..


(How do I get my points back now !?)

0
 
LVL 2

Expert Comment

by:j42
ID: 8089525
> (How do I get my points back now !?)
Post a question in the Community Support section and ask to delete this question.

Regards
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 8091851
Points refunded and placed in PAQ

Computer101
E-E Admin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Starting up a Project

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question