Solved

How can I know that the screen has changed?

Posted on 2001-08-30
12
225 Views
Last Modified: 2010-04-06
Is there any event or message that can tell me that some portion of the screen has changed? where? and the color value it has taken?
0
Comment
Question by:guitfatio
[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
  • 5
  • 2
  • 2
  • +2
12 Comments
 
LVL 1

Expert Comment

by:sundayboys
ID: 6443424
listening
0
 
LVL 1

Assisted Solution

by:sundayboys
sundayboys earned 50 total points
ID: 6443437
http:Q_20176086.html
this maybe can help you .
0
 
LVL 3

Expert Comment

by:MarcG
ID: 6443988
the Message WM_DisplayChange is fired after chges of the resolution or color depth
0
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!

 
LVL 3

Expert Comment

by:MarcG
ID: 6444002
the Message WM_DisplayChange is fired after chges of the resolution or color depth
0
 
LVL 3

Expert Comment

by:MarcG
ID: 6444004
here's an example, just a form containing a TMemo

type
  TForm1 = class(TForm)
    Memo1: TMemo;
  private
  public
    procedure WMDispChange(var message : TWMDisplayChange) ; message WM_DisplayChange;
  end;

and the procedure ...

procedure  TForm1.WMDispChange(var message : TWMDisplayChange) ;
begin
  memo1.Lines.Add('Newcolor depth : '+ IntToStr(message.BitsPerPixel));
  memo1.lines.Add('New horiz resolution : ' + IntToStr(message.Width));
  memo1.lines.Add('New vert resolution : ' + IntToStr(message.Height));
end;
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6449957
Hooking WM_PAINT may not be enough. A lot of programs/windows/components paint on the screen without using WM_PAINT at all. If you want to have a reliable method of getting notified about screen changes, you need to install a GDI hook. That is *very* hard. I would say: Better forget about that...  :-(  Maybe the WM_PAINT approach is the way to go for you, because it's much easier than hooking GDI, unfortunately, as I said, it's not a complete solution...

Regards, Madshi.
0
 

Author Comment

by:guitfatio
ID: 6452028
How can I install a GDI hook?
0
 
LVL 20

Accepted Solution

by:
Madshi earned 50 total points
ID: 6452299
Look here, but it is *very* difficult:

http://www.experts-exchange.com/jsp/qShow.jsp?qid=10938141
0
 
LVL 3

Expert Comment

by:MarcG
ID: 6453387
I'm sorry, but I'm not using WM_PAINT message ... or am I ? As far as I understand it I'm not ...

Here's what WinAPI Help says about changing screen resolution ...
"When the display mode is changed dynamically, the WM_DISPLAYCHANGE message is sent to all running applications with the following message parameters:..."
(Help for ChangeDisplaySettings)
0
 

Author Comment

by:guitfatio
ID: 6453400
This question is not related about changing screen resolution... It's about knowing when and where the screen has changed.
0
 
LVL 3

Expert Comment

by:MarcG
ID: 6453408
what ? oops, ssems I misunderstood it, I thought you where talking about the color deppth and chinging it ...
sorry if not ...
0
 
LVL 17

Expert Comment

by:geobul
ID: 9289455
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split points between sundayboys and Madshi

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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