Solved

Move (non Delphi) window

Posted on 2004-09-23
4
371 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 200 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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TServerSocket - file via sendbuf or Text via sendtext ? 1 92
Multiple image collision 13 111
How to Get Images From Server using App Tethering 11 53
QuickReport, Delphi, Shape 12 49
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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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