Board index » delphi » You May Find This Useful

You May Find This Useful

Hello all,

Here is a little something that u may find useful.

unit MinDelph;

interface

procedure MinimizeDelphi;

implementation

uses
  WinTypes, WinProcs;

procedure MinimizeDelphi;
var
  DelphiWnd: HWnd;
begin
  DelphiWnd := FindWindow('TApplication', 'Delphi');
  if DelphiWnd <> 0 then ShowWindow(DelphiWnd, SW_MINIMIZE);
end;

end.

Add the above unit to your list of project files, and in your project source:

program WHATEVER;

* snip !

begin

* Add this single line below

  MinimizeDelphi;

  Application.Title := 'WHATEVER';

* snip !

end.

Now, whenever u hit F9 to test run your application, Delphi will minimise
itself and stop cluttering the desktop.  And when u exit your App, Delphi will
pop back up itself again.

Hope you'll like it.

---
CCS

Internet: ch...@singnet.com.sg

 

Re:You May Find This Useful


ch...@singnet.com.sg (Chang Chiang Seng) wrote:

Quote
>Hello all,
>Here is a little something that u may find useful.
>unit MinDelph;
>interface
>procedure MinimizeDelphi;
>implementation
>uses
>  WinTypes, WinProcs;
>procedure MinimizeDelphi;
>var
>  DelphiWnd: HWnd;
>begin
>  DelphiWnd := FindWindow('TApplication', 'Delphi');
>  if DelphiWnd <> 0 then ShowWindow(DelphiWnd, SW_MINIMIZE);
>end;
>end.
>Add the above unit to your list of project files, and in your project source:
>program WHATEVER;
>* snip !
>begin
>* Add this single line below
>  MinimizeDelphi;
>  Application.Title := 'WHATEVER';
>* snip !
>end.
>Now, whenever u hit F9 to test run your application, Delphi will minimise
>itself and stop cluttering the desktop.  And when u exit your App, Delphi will
>pop back up itself again.

Alternatively, switch on the "Minimise on Run" checkbox in the Environment
Options dialog.

--
Isaac Hepworth                 ijh1...@cam.ac.uk
Corpus Christi College, Cambridge University, UK

Re:You May Find This Useful


Why not simply use Options/Environment/Preferences/Minimize on run ?

--
Bent Tranberg, Agder College, Grimstad
Grooseveien 36, 4890 Grimstad, Norway
e-mail: Bent.Tranb...@hia.no

Re:You May Find This Useful


Hee hee... guess I should RTFM more, there is an option to minimize Delphi on
run in the environment option page... :-|

---
CCS

Internet: ch...@singnet.com.sg

Re:You May Find This Useful


ch...@singnet.com.sg (Chang Chiang Seng) wrote:

]Hello all,
]
]Here is a little something that u may find useful.
]
]
]unit MinDelph;
]
]interface
]
]procedure MinimizeDelphi;
]
]implementation
]
]uses
]  WinTypes, WinProcs;
]
]procedure MinimizeDelphi;
]var
]  DelphiWnd: HWnd;
]begin
]  DelphiWnd := FindWindow('TApplication', 'Delphi');
]  if DelphiWnd <> 0 then ShowWindow(DelphiWnd, SW_MINIMIZE);
]end;
]
]end.
]
]
]Add the above unit to your list of project files, and in your project source:
]
]program WHATEVER;
]
]* snip !
]
]begin
]
]* Add this single line below
]
]  MinimizeDelphi;
]
]  Application.Title := 'WHATEVER';
]
]* snip !
]
]end.
]
]
]Now, whenever u hit F9 to test run your application, Delphi will minimise
]itself and stop cluttering the desktop.  And when u exit your App, Delphi will
]pop back up itself again.
]
]Hope you'll like it.
]
]---
]CCS
]
]Internet: ch...@singnet.com.sg
]

An even easier way to accomplish this is to check
'Tools->Options->Preferences->Minimize on run'.

PeterS

Re:You May Find This Useful


On 22 May 1996 06:08:17 GMT, Chang Chiang Seng with Singapore Telecom
Internet Service commented on You May Find This Useful:

Not at all!  Talk about re-inventing the wheel.  

Have you tried using the menu choice, Tools | Options... and in the
Preferences tab check Minimize on run.

As Homer would say, "DOH!!!"

---------- Original attached below ----------

Quote
>Hello all,

>Here is a little something that u may find useful.

>unit MinDelph;

>interface

>procedure MinimizeDelphi;

>implementation

>uses
>  WinTypes, WinProcs;

>procedure MinimizeDelphi;
>var
>  DelphiWnd: HWnd;
>begin
>  DelphiWnd := FindWindow('TApplication', 'Delphi');
>  if DelphiWnd <> 0 then ShowWindow(DelphiWnd, SW_MINIMIZE);
>end;

>end.

>Add the above unit to your list of project files, and in your project
>source:

>program WHATEVER;

>* snip !

>begin

>* Add this single line below

>  MinimizeDelphi;

>  Application.Title := 'WHATEVER';

>* snip !

>end.

>Now, whenever u hit F9 to test run your application, Delphi will minimise
>itself and stop cluttering the desktop.  And when u exit your App, Delphi
>will
>pop back up itself again.

>Hope you'll like it.

>---
>CCS

>Internet: ch...@singnet.com.sg

Other Threads