Solved

Get Invalid Regions

Posted on 1997-05-01
7
528 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
  • 4
  • 3
7 Comments
 
LVL 2

Accepted Solution

by:
gysbert1 earned 80 total points
Comment Utility
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
Comment Utility
 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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 2

Expert Comment

by:gysbert1
Comment Utility
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
Comment Utility
 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
Comment Utility
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
Comment Utility
 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now