Solved

Move (non Delphi) window

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month4 days, 6 hours left to enroll

630 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