Solved

move-mania

Posted on 1999-01-12
8
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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