duke_n
asked on
move-mania
How to move and resize external app window if I know it's handle?
Use sendmessage with WM_SIZE
Hmm. I think the more official way would be to call MoveWindow.
Regards, Madshi.
Regards, Madshi.
BOOL MoveWindow(
HWND hWnd, // handle of window
int X, // horizontal position
int Y, // vertical position
int nWidth, // width
int nHeight, // height
BOOL bRepaint // repaint flag
);
HWND hWnd, // handle of window
int X, // horizontal position
int Y, // vertical position
int nWidth, // width
int nHeight, // height
BOOL bRepaint // repaint flag
);
ASKER
//to madshi
and what is I only want to RESIZE the window or only to MOVE it,
how shall I know the other two parameters?
and what is I only want to RESIZE the window or only to MOVE it,
how shall I know the other two parameters?
ASKER
I mean: how to retrieve window position and size?
You could call GetWindowRect before the MoveWindow call.
BOOL GetWindowRect(
HWND hWnd, // handle of window
LPRECT lpRect // address of structure for window coordinates
);
Or you could use SetWindowPos instead of MoveWindow. You can give several Flags into SetWindowPos. But I like MoveWindow more, because it's much easier to call...
Regards, Madshi.
BOOL GetWindowRect(
HWND hWnd, // handle of window
LPRECT lpRect // address of structure for window coordinates
);
Or you could use SetWindowPos instead of MoveWindow. You can give several Flags into SetWindowPos. But I like MoveWindow more, because it's much easier to call...
Regards, Madshi.
ASKER
//to madshi
that's it!!!!!
this is just what I needed.
one last STUPID Q:
is there a possibility to 2D rotate windows??????
that's it!!!!!
this is just what I needed.
one last STUPID Q:
is there a possibility to 2D rotate windows??????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.