Solved

Form Resizing and WM_NCHITTEST

Posted on 2000-04-28
6
896 Views
Last Modified: 2010-05-19
I want to create a size grip control that acts like the size grip on the status bar. But you should be able to set it on every control (not just on the form itself). It should be aligned at every edge of the parent control.
What I tried is to create a control and catch the WM_NCHITTEST of the parent form and the control itself. This worked but only if the controls parent was the form itself, cause windows doesn't send the WM_NCHITTEST message to the form if a control answered it positive. Any idea how I can make the control resizing the form.
Please don't post answers like mouse catching and just call ParentForm.SetBounds(...). I know doing that.
But your comments are always welcome >;o}
Thanx for your help, ptm.
0
Comment
Question by:ptmcomp
6 Comments
 
LVL 3

Expert Comment

by:shenqw
ID: 2760846
listen
0
 
LVL 3

Expert Comment

by:raidos
ID: 2761723
Hmmz...

If you can catch the mousedown event
on your "size grip" this shouldn't be to difficult.

On the MouseDown event just do something like this.

Begin
  releasecapture;
  <Parent>.Perform(WM_Syscommand, $F008,0);
End;

That's atleast one way of resizing Components/Forms.

Good luck.

//raidos
0
 
LVL 10

Author Comment

by:ptmcomp
ID: 2761839
After I went to bed last night, I had the same Idea. But I think it works only for the bottom right edge and only if the window has a system menu. (My window is a toolsizewindow.)
Well I'll try it today.
Regards, ptm.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
LVL 3

Accepted Solution

by:
shenqw earned 150 total points
ID: 2763273
$f001:  left
$f002:  right
$f003:  top
$f004:  top_left
$f005:  top_right
$f006:  bottom
$f007:  left_bottm
$f008:  bottom_right
0
 
LVL 10

Author Comment

by:ptmcomp
ID: 2767524
Where did you got this constants?
To raidos: Sorry I can't grade both of you. Shengw helped me more, because he knew the constants diffrent from SC_SIZE.
Thanks a lot, ptm.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2782733
listenning
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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