Solved

WinExec -  SW_ShowMinimized

Posted on 1997-06-10
4
1,969 Views
Last Modified: 2012-06-21
I must be getting tired....

I Launch an app (from Delphi 1) using WinExec and I specify SW_ShowMinimized for the visibility.  If the program is something like Notepad etc.. everything works OK, the app is minimized.  If I specify one of my Delphi apps, it is like SW_ShowNormal.  The new app doesn't minimize.  

What am I missing here ??
0
Comment
Question by:icampbe1
  • 2
4 Comments
 

Expert Comment

by:bsys
ID: 1336964
I don't have any Delphi IDE with me here but could it be that when you launch your proggy that the first form is set to normal because it is stated in the source that way??
0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336965
No. I don't do anything to specifically keep the form at full size.  Send me a comment with a Delphi example.  I'm gonn reject this so I can get some other answers.

Thanks,

Ian C.

0
 
LVL 1

Accepted Solution

by:
buemoh earned 70 total points
ID: 1336966
Hallo icampbe1,

your problem is, that your programs, written with Delphi, don't recognize the SW_SHOWMINIMIZED, because each Delphi program has a hidden application window, which gets this information and not the shown form.

If you want, that your program should be minimized, then you've to set the main form window as minimized like this:

procedure TForm1.FormCreate( Sender : TObject );
begin
  ShowWindow( Handle, cmdShow );
end;

If now the application is called with SW_SHOWMINIMIZED then your form window recognize this and is shown minimized.

Hope, that's what you want.

Bye

Hartwig

-----------------------------------------------------------------------------------------------------
///\\\ Hartwig MOTAL ///\\\  e-mail: moh@bue.magwien.gv.at
 Weinberggasse 60/9/7, A-1190  Vienna/Austria/Europe

0
 
LVL 2

Author Comment

by:icampbe1
ID: 1336967
That is exactly what I wanted.  Note however that minimizing the form leaves the application still there.  I want the application to be iconic as well.  If I showform( application.handle, cmdshow ) as well, then I get two icons on the task bar.  But I can solve this.  Your answer is excellent.

Thanks,

Ian Campbell
Toronto.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

11 Experts available now in Live!

Get 1:1 Help Now