How can I make a window, that can not resized
with a mouse by a user
Volker
"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
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
"Volker W. Walter" <v...@metrohm.ch> wrote in message
news:3C4BFE21...@metrohm.ch...
Sorry
neither BorderStyle
nor bsDialog or bsSingle
are WinApi
perhaps they belong to VCL.
I am interstested using only Win32
(Windows, Messages, MmSystem,..)
Volker
Don't supply the WS_THICKFRAME style when calling CreateWindow(Ex)
(WS_OVERLAPPEDWINDOW includes WS_THICKFRAME by default).
HTH
Clemens
Thank you
this seems to help
Volker
> 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
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
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
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
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