Resizing windows through code.

Started by
1 comment, last by Roof Top Pew Wee 22 years, 6 months ago
I have a windowed DirectX program which makes the windows so that they have no buttons and cannot be resized, only moved around. However, there are times when I want the program to resize the windows (to match the size of bitmaps when they are loaded). I''m guessing there is a function that either accepts a hWnd or is a member of this handle which will allow me to pass a rectangle and resize the window the the rect passed. Anyone know of such a function, or one that will give me the same result? Thanks in advance. --Vic--
Advertisement
Off the top of my head: SendMessage(hWnd, WM_RESIZE, x, y)
look it up to see how it really works
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
WM_RESIZE ? this isn''t mentioned in the MSDN - I think your refering to the WM_SIZE which is a notification message that a resize is occuring, not a command to resize.

You could try

BOOL SetWindowPos(
HWND hWnd, // handle to window
HWND hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
UINT uFlags // window-positioning flags
);

with the uFlag set to SWP_NOMOVE etc

Hope this helps
Box2020<CEng&,CRnd*>

This topic is closed to new replies.

Advertisement