Solved

Get Invalid Regions

Posted on 1997-05-01
7
538 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
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!

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 156
Error E2158 compiling with Delphi XE10 Seattle 2 142
Firemonkey Queue list 1 51
Formating a integer number to float 2 10
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…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

710 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