Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get Invalid Regions

Posted on 1997-05-01
7
Medium Priority
?
543 Views
Last Modified: 2010-04-03
 How can I get hold of the invalid region of a component. They seem to validate the region before I get a chance to check it. I've tried calling GetUpdateRgn in a components paint method (before inherited is executed), but the region I get seems to be empty.
  When can I get hold of the Update Region for a component?
0
Comment
Question by:StevenB
[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
  • 4
  • 3
7 Comments
 
LVL 2

Accepted Solution

by:
gysbert1 earned 160 total points
ID: 1335839
Have a look at WM_NCPAINT

It has the parameter : hrgn = (HRGN) wParam;

From the windows API help:
  An application can intercept this message and paint its own custom window frame. The clipping region for a window is always rectangular, even if the shape of the frame is altered.

Remember that if the repaint is needed for a very small region windows may do it without sending you the message. This happens eg. when pulldown menus obscure a window or icons are dragged over them. In these cases no invalid regions are created and windows stores a small bitmap of the window over which you have no control.
0
 
LVL 4

Author Comment

by:StevenB
ID: 1335840
 Sorry that I've not responded to this answer yet. I'm not ignoring it, it's just that I'm very busy with something else currently. I'll respond properly on Monday, when I've had proper time to investigate.

  Thanks for your patience,
    Steven.
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1335841
I wish more people would be as nice as to let one know. Some of my answers are pending for more than two months now without any reply !
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Expert Comment

by:gysbert1
ID: 1335842
I wish more people would be as nice as to let one know. Some of my answers are pending for more than two months now without any reply !

Don't bother sendign a message in reply to this. I'll wait till monday ;^)
0
 
LVL 4

Author Comment

by:StevenB
ID: 1335843
 I know this is a little outside the scope of the original question, but what do you know about how non-windowed controls broadcast paint instructions? The components I'm using are non-windowed controls and the advice you've given above works fine when, for example, a form, or seperate window is dragged over my controls, but when they are dragged over each other they do not seem to trigger the code I've written.
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1335844
All controls must be within a windowed control. The window that hosts the controls receives all the messages that cause the window to repaint. As far as I know everything that is non-windowd within a window is handled just like it is graphics and has to be redrawn by the window containing it if it is overwritten. Thus the window hosting your control should receive the messages ...

If it doesn't I am clueless ;)
0
 
LVL 4

Author Comment

by:StevenB
ID: 1335845
 Yes, I've been relaying the invalid region from the parent windowed control down to the non-windowed components, using the event you suggested, its just that the event, unsurprisingly, isn't triggered by simply dragging the non-windowed components about on their parent. I suspect that I'm going to have to do my own internal invalidation routines for non-windowed controls.

  Cheers for the advice, Steven.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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