Solved

Get Invalid Regions

Posted on 1997-05-01
7
541 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 80 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
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.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month6 days, 18 hours left to enroll

623 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