Solved

Resetting the Focus

Posted on 1997-05-19
3
251 Views
Last Modified: 2010-04-04
How do you set the focus to a dos program in delphi. The dos program is already running, but minimized.
0
Comment
Question by:Deep Diver
[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
3 Comments
 

Author Comment

by:Deep Diver
ID: 1336455
Edited text of question
0
 

Accepted Solution

by:
kangadru earned 20 total points
ID: 1336456
You have to use 2 API calls.  Depending on if you want to deal with Minimized or not, I prefer not to maximize minimized windows as a rule, but there are exceptions.In the Following Ex. The FindWindow Call uses the Title Bar name of the Window to find a Window HAndle and the Show Window to restore it  and give it the focus.  Commented out you'll see SetForeGround Window, that's my preferance as it does not restore the window and does not preempt the keyboard input. it only sets that window active.A third method would be to use SetWindowPos() and you can make it TopMost with out bringin it forward to the top of the ZOrder.var
  theHAndle : HWND;
begin
  theHandle := FindWindow(nil, 'Bash');
//  setForeGroundWindow(theHandle);
  ShowWindow(theHandle, SW_SHOWNORMAL);
end;
Andy
0
 

Author Comment

by:Deep Diver
ID: 1336457
Type the showWindow Command two times...Once is not anough
0

Featured Post

Independent Software Vendors: 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

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…
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 this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

617 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