Solved

Which area of another application was "repainted"?

Posted on 2007-03-27
2
189 Views
Last Modified: 2010-04-05
How can my Delphi application (A) know which area of "someone else's application (B)" was repainted?

when you put something over a form, and then move it. I think Windows repaints just the area that was covered, not the whole area.
I would like to know the position and size of this area that is being repainted.
Is there any hook that can tell me teh region that needed to be repainted?

eg. My aplication is watching "Firefox" and I MOVE A "NOTEPAD" over it.
as the notepad is moved, firefox is repainted in those areas.
0
Comment
Question by:TheRealLoki
[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
2 Comments
 
LVL 16

Accepted Solution

by:
CodedK earned 125 total points
ID: 18806322
Hi TheRealLoki.

>> I think Windows repaints just the area that was covered, not the whole area.
I think that it paints all the object.. not just an area.

Use GetTopWindow ,GetNextWindow.

I think if you just put a timer in your application and then add some code to find which window
is the top in z axis then this window will be refreshed and repainted.
GetTopWindow will get the current top window in z order.
The window that will come in that list first and change your current first window then this window will
be refreshed and repainted. Then your timer will fire an event.

Hope this helps.
0
 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 125 total points
ID: 18808196
From MSDN:
A window may receive internal paint messages as a result of calling RedrawWindow with the RDW_INTERNALPAINT flag set. In this case, the window may not have an update region. An
application should call the GetUpdateRect function to determine whether the window has an
update region.

The GetUpdateRect function retrieves the coordinates of the smallest rectangle that completely
encloses the update region of the specified window. GetUpdateRect retrieves the rectangle in
logical coordinates.

Also, getting the PAINTSTRUCT from a hook to BeginPaint and checking the rcPaint member
would be the way to do it although I don't know how or if it is possible.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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