Solved

Move (non Delphi) window

Posted on 2004-09-23
4
367 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
  • 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

21 Experts available now in Live!

Get 1:1 Help Now