Solved

move-mania

Posted on 1999-01-12
8
127 Views
Last Modified: 2010-04-06
How to move and resize external app window if I know it's handle?
0
Comment
Question by:duke_n
  • 4
  • 3
8 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1356018
Use sendmessage with WM_SIZE
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1356019
Hmm. I think the more official way would be to call MoveWindow.

Regards, Madshi.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1356020
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
   );      
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:duke_n
ID: 1356021
//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?
0
 
LVL 1

Author Comment

by:duke_n
ID: 1356022
I mean: how to retrieve window position and size?
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1356023
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.
0
 
LVL 1

Author Comment

by:duke_n
ID: 1356024
//to madshi
that's it!!!!!
this is just what I needed.
one last STUPID Q:
is there a possibility to 2D rotate windows??????
0
 
LVL 20

Accepted Solution

by:
Madshi earned 80 total points
ID: 1356025
Hi duke_n,

>> is there a possibility to 2D rotate windows??????

Hmmm. You CAN do it, but it will be quite difficult. You'll have to do it all by yourself.
You'll have to use SetWindowRgn with a region created by CreatePolygonRgn. This polygon must hold the four corners of the rotated window. Then you'll have to rotate the pixel window content by your own and draw it into the cycled region.
Uaaa... I think it is a lot of work, and I'm not sure if the effect is worth this work.

Regards, Madshi.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question