One of the consistent problems I've run into (a couple of projects now) is the need to show a small form upon an event which is on top of other windows, and then dismisses itself after a certain amount of time. The main reason is to be able to show more information (even some graphical data) than a hint text.
Any ideas on how to solve this? The main thing I've done is as follows, using a button to simulate what I'm trying to do:
The major problems:
1. Getting the event to fire once and only once, no matter what? I'm not sure what I did is the best way from an "extensible" standpoint, but it seems to work.
2. Making sure the window shows no matter what. If the application happens to not have focus (which is realistic given these apps, as they are notification area programs), the extended hint window (form2) has a way of being buried or not shown at all.
3. Since they're notification area programs, the other unrelated problem is one of positioning the form. One problem I noticed on varying windows platforms is that SHAppBarMessage fails on the older ones (I have intentions on making one of the projects as universal as possible). I couldn't find any documentation on how to find the app bar outside of that API, so I'm wondering am I stuck here or is there another way to do it?
Ideas?
Any ideas on how to solve this? The main thing I've done is as follows, using a button to simulate what I'm trying to do:
Code:
// form1
procedure TForm1.Button1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Form2.Show;
Button1.OnMouseMove := nil;
end;
// form2
procedure TForm2.FormCreate(Sender: TObject);
begin
Timer1.Enabled := true;
end;
procedure TForm2.Timer1Timer(Sender: TObject);
begin
Form2.Close;
Form1.Button1.OnMouseMove := Form1.Button1MouseMove;
end;
The major problems:
1. Getting the event to fire once and only once, no matter what? I'm not sure what I did is the best way from an "extensible" standpoint, but it seems to work.
2. Making sure the window shows no matter what. If the application happens to not have focus (which is realistic given these apps, as they are notification area programs), the extended hint window (form2) has a way of being buried or not shown at all.
3. Since they're notification area programs, the other unrelated problem is one of positioning the form. One problem I noticed on varying windows platforms is that SHAppBarMessage fails on the older ones (I have intentions on making one of the projects as universal as possible). I couldn't find any documentation on how to find the app bar outside of that API, so I'm wondering am I stuck here or is there another way to do it?
Ideas?