Link to home
Start Free TrialLog in
Avatar of duke_n
duke_n

asked on

move-mania

How to move and resize external app window if I know it's handle?
Avatar of Mirkwood
Mirkwood

Use sendmessage with WM_SIZE
Hmm. I think the more official way would be to call MoveWindow.

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
   );      
Avatar of duke_n

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?
Avatar of duke_n

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.
Avatar of duke_n

ASKER

//to madshi
that's it!!!!!
this is just what I needed.
one last STUPID Q:
is there a possibility to 2D rotate windows??????
ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial