Solved

Which area of another application was "repainted"?

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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