?
Solved

Progress bar (in delphi)

Posted on 2003-03-05
4
Medium Priority
?
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans

752 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