Solved

move-mania

Posted on 1999-01-12
8
126 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now