[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Which area of another application was "repainted"?

Posted on 2007-03-27
2
Medium Priority
?
193 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 375 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 375 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 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