Solved

I can't switch!

Posted on 1999-01-28
4
159 Views
Last Modified: 2010-04-06
I have a DOS Pascal program running in MS-DOS Full Screen Mode. And this DOS program calls a Windows Delphi program.

After closing the Delphi program, the screen remains in Windows and I have to press ALT-TAB to switch back to DOS Full Screen Mode. This, of course, does not happen when I execute the DOS program in Window(Not Full Screen) MS-DOS Mode.

My question is, is it possible to, say using SendMessage(...), to maximize a full screen MS-DOS window, instead of having me pressing ALT-TAB? I've tried but failed...*sigh*

Any hint?
0
Comment
Question by:foxvision
[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 20

Accepted Solution

by:
Madshi earned 150 total points
ID: 1363666
Hi foxvision,

try this one:

procedure PressAltTab;
begin
  keybd_event(VK_MENU,0,0,0);
  keybd_event(VK_TAB, 0,0,0);
  keybd_event(VK_TAB, 0,KEYEVENTF_KEYUP,0);
  keybd_event(VK_MENU,0,KEYEVENTF_KEYUP,0);
end;

Regards, Madshi.
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1363667
Or prehaps you could call FindWindow with the caption of your dos program, then ShowWindow or SetForegroundWindow.

Cheers,
Phil

0
 

Author Comment

by:foxvision
ID: 1363668
Wow! It works in Delphi 4. Can I used it in Delphi 1 as well?

Good Days and Thanks,
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363669
No, sorry. "keybd_event" is a win32 function. So you need at least D2.

Regards, Madshi.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
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 Month8 days, 23 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