Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Move (non Delphi) window

Posted on 2004-09-23
4
Medium Priority
?
373 Views
Last Modified: 2010-04-05
Hi!
I know the caption of a window and want to move it to the upper left corner of the screen. It's out of sight due to a bug in the dual head video driver :´-(

Alex
0
Comment
Question by:__alex
[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
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
php4delphi earned 800 total points
ID: 12131712
procedure TForm1.Button1Click(Sender: TObject);
var
 W : HWND;
begin
  WinExec('notepad.exe', SW_SHOW);
  W := FindWindow(nil, 'Untitled - Notepad');
  if W > 0 then
   SetWindowPos(W, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE);
end;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12131716
u could use the findwindow-api to get the handle
and then the setwindowpos-api to set the new position

currently i'm not able to provide a sample, sorry

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12131727
a bit too late ;-))
php4delphi, provided already what i have meant -> good work, php4delphi  
0
 
LVL 2

Author Comment

by:__alex
ID: 12131831
Works like a charm!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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