Solved

WinExec -  SW_ShowMinimized

Posted on 1997-06-10
4
2,011 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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