Solved

move-mania

Posted on 1999-01-12
8
125 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
Comment Utility
Use sendmessage with WM_SIZE
0
 
LVL 20

Expert Comment

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

Regards, Madshi.
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
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
Comment Utility
//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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Author Comment

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

Expert Comment

by:Madshi
Comment Utility
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
Comment Utility
//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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

12 Experts available now in Live!

Get 1:1 Help Now