Solved

Form Resizing and WM_NCHITTEST

Posted on 2000-04-28
6
875 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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