Solved

Form Resizing and WM_NCHITTEST

Posted on 2000-04-28
6
882 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

895 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

18 Experts available now in Live!

Get 1:1 Help Now