Solved

Which area of another application was "repainted"?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

20 Experts available now in Live!

Get 1:1 Help Now