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
Solved

WinExec -  SW_ShowMinimized

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

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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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