Resizing windows through code.
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--
Off the top of my head: SendMessage(hWnd, WM_RESIZE, x, y)
look it up to see how it really works
look it up to see how it really works
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement