Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NO resize

45 views
Skip to first unread message

Volker W. Walter

unread,
Jan 21, 2002, 6:40:17 AM1/21/02
to
Hi,

How can I make a window, that can not resized
with a mouse by a user

Volker

Erik Ronström

unread,
Jan 21, 2002, 6:43:23 AM1/21/02
to

"Volker W. Walter" wrote:

> How can I make a window, that can not resized
> with a mouse by a user

Set BorderStyle of the form to bsDialog. You may want to hide the
minimize/maximize buttons as well; that is done by changing the
BorderIcons property of the form.

Erik

V. Shypoorchian

unread,
Jan 21, 2002, 7:05:42 AM1/21/02
to
Hi,

If you want to be able to minimize and maximize the window, then you should
set BorderStyle to bsSingle. Setting BorderStyle to bsDialog will hide the
min. en max. buttons.

--
mvg,

V. Shypoorchian
Keyword Info Systems

Va...@keyword.nl


"Volker W. Walter" <v...@metrohm.ch> wrote in message
news:3C4BFE21...@metrohm.ch...

Volker W. Walter

unread,
Jan 21, 2002, 8:43:57 AM1/21/02
to
> BorderStyle to bsSingle.
> Setting BorderStyle to bsDialog

Sorry
neither BorderStyle
nor bsDialog or bsSingle

are WinApi
perhaps they belong to VCL.

I am interstested using only Win32
(Windows, Messages, MmSystem,..)

Volker

Clemens Ladisch

unread,
Jan 21, 2002, 10:32:56 AM1/21/02
to
Volker W. Walter wrote:
> How can I make a window, that can not resized with a mouse by a user

Don't supply the WS_THICKFRAME style when calling CreateWindow(Ex)
(WS_OVERLAPPEDWINDOW includes WS_THICKFRAME by default).


HTH
Clemens

Volker W. Walter

unread,
Jan 21, 2002, 10:48:15 AM1/21/02
to
> Don't supply the WS_THICKFRAME style when calling CreateWindow(Ex)
> (WS_OVERLAPPEDWINDOW includes WS_THICKFRAME by default).

Thank you
this seems to help
Volker

Volker W. Walter

unread,
Jan 21, 2002, 10:55:56 AM1/21/02
to


> Don't supply the WS_THICKFRAME style when calling CreateWindow(Ex)
> (WS_OVERLAPPEDWINDOW includes WS_THICKFRAME by default).


WS_OVERLAPPEDWINDOW-WS_THICKFRAME
now creates a window which can't be overlapped by other windows

Volker

Clemens Ladisch

unread,
Jan 21, 2002, 11:25:49 AM1/21/02
to
Volker W. Walter wrote:
> WS_OVERLAPPEDWINDOW-WS_THICKFRAME

That should be WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME.

> now creates a window which can't be overlapped by other windows

I think you have to supply WS_BORDER or some other flag. Please look at
the help for CreateWindowEx for the WS_xxx and WS_EX_xxx styles.


HTH
Clemens

Volker W. Walter

unread,
Jan 22, 2002, 4:23:04 AM1/22/02
to
> That should be WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME.

Thank you for your suggestions

Now I am using for windows style in CreateWindow

WS_OVERLAPPEDWINDOW AND NOT WS_THICKFRAME AND NOT WS_MAXIMIZEBOX =$CA0000

which is close to my wishes.

But Windows .GetSystemMetrics(Windows .SM_CXSIZEFRAME);
and Windows .GetSystemMetrics(Windows .SM_CXFRAME);
gives a frame size of 4 pixels

I believe that the not thick frame is only 3 pixels.
Can someone advise my what System metrics constant I have to use ?

Volker

Volker W. Walter

unread,
Jan 22, 2002, 6:26:39 AM1/22/02
to Clemens Ladisch
Now I have found
Windows .GetSystemMetrics(Windows .SM_CXDLGFRAME);
Windows .GetSystemMetrics(Windows .SM_CYDLGFRAME);
gives a frame size of 3 pixels

Volker

Clemens Ladisch

unread,
Jan 23, 2002, 10:08:54 AM1/23/02
to
Volker W. Walter wrote:
> Now I am using for windows style in CreateWindow
>
> WS_OVERLAPPEDWINDOW AND NOT WS_THICKFRAME AND NOT WS_MAXIMIZEBOX =$CA0000
>
> which is close to my wishes.

WS_OVERLAPPEDWINDOW is defined as WS_OVERLAPPED or WS_CAPTION or
WS_SYSMENU or WS_THICKFRAME or WS_MINIMIZEBOX or WS_MAXIMIZEBOX.

Your window style then would be
WS_OVERLAPPED or WS_CAPTION or WS_SYSMENU or WS_MINIMIZEBOX.

> But Windows .GetSystemMetrics(Windows .SM_CXSIZEFRAME);
> and Windows .GetSystemMetrics(Windows .SM_CXFRAME);
> gives a frame size of 4 pixels
>
> I believe that the not thick frame is only 3 pixels.
> Can someone advise my what System metrics constant I have to use ?

If you use CreateWindowEx, you can use extended style style as well.
Try combinations of WS_EX_DLGMODALFRAME, WS_EX_WINDOWEDGE and
WS_EX_CLIENTEDGE.


HTH
Clemens

Marc Scheuner

unread,
Jan 24, 2002, 8:52:51 AM1/24/02
to
On Mon, 21 Jan 2002 14:43:57 +0100, "Volker W. Walter" <v...@metrohm.ch>
wrote:

I don't quite see why you want to do this to you, if you use Delphi
and have all these easy ways to do it, but......

if you want to rely strictly on Win32 API, you'll need to trap the
WM_RESIZE message and set the size to the same at all times. Check
your Win32 API documentation for details as to what gets passed along
with the WM_RESIZE message......

Marc


------------------------------------------------------------------------
Marc Scheuner Software Engineer
Quest Software Canada Halifax, Nova Scotia, Canada
Email: marc.s...@quest.com http://www.quest.com

0 new messages