runebj
asked on
Detecting Full Screen
I have a Delphi app that has the FormStyle property set to fsStayOnTop. The app needs to be on top of other apps - even when other apps are running in full screen mode (for example IE or Acrobat Reader).
What happens is that when an app goes into full screen mode a black box representing my app is displayed on top of the full screen application. (This can also be reproduced by opening Task Manager and then taking another app to full screen.) I need to detect the fact that another app has entered into full screen mode and then force my app to repaint. And here lies problem #2... Form.Repaint does not work. However, if I do a Form.Hide; Form.Show; all is well (would like to avoid the latter - but this is not critical).
Any ideas?
runebj
What happens is that when an app goes into full screen mode a black box representing my app is displayed on top of the full screen application. (This can also be reproduced by opening Task Manager and then taking another app to full screen.) I need to detect the fact that another app has entered into full screen mode and then force my app to repaint. And here lies problem #2... Form.Repaint does not work. However, if I do a Form.Hide; Form.Show; all is well (would like to avoid the latter - but this is not critical).
Any ideas?
runebj
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I looked again at your objective and tested the code with IE in "Full Screen" (F11) and Acrobat Reader 5 (in windows style full screen) and my form remained on top. I created a simple app with a checkbox containing the following OnClick event handler...
procedure TForm1.CheckBox1Click(Send er: TObject);
begin
If CheckBox1.checked then
begin
SetFormOnTop(self);
end else
begin
SetFormNotOnTop(self);
end;
end;
I hope it does the job for you!
Chuck
procedure TForm1.CheckBox1Click(Send
begin
If CheckBox1.checked then
begin
SetFormOnTop(self);
end else
begin
SetFormNotOnTop(self);
end;
end;
I hope it does the job for you!
Chuck
ASKER
Hi Chuck,
Sorry for not getting back to you sooner, but I've been away for a week. I already use the API call you specify to set the window to stay on top, but reissuing the command does not help. That is - it works for IE, but not for Acrobat reader. It looks like IE simply maximizes itself and removes borders and menus, but it does not really go into full screen mode (the taskbar is still there).
Thank you very much for the effort though...
All the best,
Runebj
Sorry for not getting back to you sooner, but I've been away for a week. I already use the API call you specify to set the window to stay on top, but reissuing the command does not help. That is - it works for IE, but not for Acrobat reader. It looks like IE simply maximizes itself and removes borders and menus, but it does not really go into full screen mode (the taskbar is still there).
Thank you very much for the effort though...
All the best,
Runebj
ASKER
Sorry for not finalizing before - must have slipped my mind...
My question was not really answered, but I split the points between the two respondants anyway as the answers given may very well help others and to thank them for their efforts.
All the best,
Runebj
My question was not really answered, but I split the points between the two respondants anyway as the answers given may very well help others and to thank them for their efforts.
All the best,
Runebj
ASKER
First of all, my app does not have focus. Also, I don't know which message to monitor. I can write a hook, but I still haven't been able to find any message, flag or other signal that is passed/set when an app goes into full screen mode.
Btw. I've also tried Invalidate. It does nothing. It seems that Windows figures "if one app is in full screen mode, no other app can possibly be visible, so ignore paint messages".
Any more ideas?
runebj