Solved

Which area of another application was "repainted"?

Posted on 2007-03-27
2
180 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now