Minimize Main window on startup 
Author Message
 Minimize Main window on startup

Hi,

my question concerns BPW 7.0 (Windows traget).
I have a main windows (a dialog box created using Resource Workshop)
and I want to perform the following :

If my appliaction is executed without Command-Line parameters, the
window is displayed and waits for commands. This works fine.

If my application is executed with Command-line parameters, I want to
minimize it (this part doesn't work) and execute the command before
exiting automatically.

When I try to minimize my window in the SetupWindow procedure using
Winprocs.CloseWindow(HWindow), my window effectively minimize but is
restored again between SetupWindow and messages processing
(MessageLoop).

If I minimize it in my TApplication.MessageLoop (before any message
processing), my window stays minimized but it is displayed before
reducing its size which is unwanted.
So How can I minimize a main window at startup (a dialog box) as is
done for example with WinSpector ?

Thanks in advance for any help.

David.



Wed, 18 Jun 1902 08:00:00 GMT  
 Minimize Main window on startup

Quote:

> Hi,

> my question concerns BPW 7.0 (Windows traget).
> I have a main windows (a dialog box created using Resource Workshop)
> and I want to perform the following :

> If my appliaction is executed without Command-Line parameters, the
> window is displayed and waits for commands. This works fine.

> If my application is executed with Command-line parameters, I want to
> minimize it (this part doesn't work) and execute the command before
> exiting automatically.

The system-defined variable CmdShow determines the size status of the window.
Its default value is sw_Restore (for all possible values see the help
screen on Show Window).

You program wants to look like this:

var
  ThisApp: TThisApp;

begin
  if paramstr(1) <> '' then CmdShow:=sw_minimize;
  ThisApp.Init('xyxyxyxy');
  ThisApp.Run;
  ThisApp.Done;
end.

Brian Anderson.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Minimize on Startup / Unresponsive Accelerator Key

2. Minimize on Startup(Again)

3. Calling CRT windows as child windows of main window

4. Minimizing Windows

5. Interbase startup under Windows NT

6. Dialog a main window

7. Dialog as main window

8. Q: How to minimize Main forn while other forms stay normal?

9. Equivalent of VB "Sub Main" startup?

10. Run Minimized

11. DataSourceDataChange event fires when form is minimized?

12. Minimizing and Maximizing Delphi programs.

 

 
Powered by phpBB® Forum Software