Minimize on Startup(Again) 
Author Message
 Minimize on Startup(Again)

Quote:

> I'm assuming you're using OWL for this, my replies are based on that
> assumption.

Yes I am.

Quote:
> How are you trying to do this now?  If I were to do such I would save
> the state in an .INI file, read that file when my App starts, and
> override the Init constructor to add that style to the
> TApplication.Attr field.

Below is a snippit of code that I currently have in the Init section of my
main application window object definitions.

  constructor TMainWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  begin
    if WinMinimized then
      Attr.Param := Attr.Param or ws_Minimize;
    TDlgWindow.Init(AParent, ATitle);
  end;

This doesn't work either, even after I did as you suggested. the WinMinimized
flag is True if the application was iconized on termination. Otherwise it is
False.

Quote:
> If your window is based on TDlgWindow then this is a known "bug" in
> OWL where the ProcessAccels method of TApplication never gets called
> because ProcessDlgMsg() is called first and it swallows the
> accelerator messages; the simple solution is to override the
> ProcessAppMsg() method like so:

> function TMyApplication.ProcessAppMsg( var Message : TMsg ): boolean; virtual;
> begin
>   ProcessAppMsg := ProcessAccels( Message ) ;
> end ;

I am using a TDlgWindow object. This quick fix did the trick. Thanks! :)

Quote:
> Regards,

> Stephen Posey


Best Regards,
Scott McIntyre

======================================================================

  11400 ROBINWOOD DRIVE                PHONE: 301-790-2800 x327
  HAGERSTOWN MD 21742-6590 USA           FAX: 301-739-0737
======================================================================
              Home Page: http://www.*-*-*.com/
======================================================================



Wed, 18 Jun 1902 08:00:00 GMT  
 Minimize on Startup(Again)

Quote:

> I'm assuming you're using OWL for this, my replies are based on that
> assumption.

Yes I am.

Quote:
> How are you trying to do this now?  If I were to do such I would save
> the state in an .INI file, read that file when my App starts, and
> override the Init constructor to add that style to the
> TApplication.Attr field.

Below is a snippit of code that I currently have in the Init section of my
main application window object definitions.

  constructor TMainWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  begin
    if WinMinimized then
      Attr.Param := Attr.Param or ws_Minimize;
    TDlgWindow.Init(AParent, ATitle);
  end;

This doesn't work either, even after I did as you suggested. the WinMinimized
flag is True if the application was iconized on termination. Otherwise it is
False. Unfortunately, the window still comes up in its original style. Did I
misinterpret something you said earlier?

Quote:
> If your window is based on TDlgWindow then this is a known "bug" in
> OWL where the ProcessAccels method of TApplication never gets called
> because ProcessDlgMsg() is called first and it swallows the
> accelerator messages; the simple solution is to override the
> ProcessAppMsg() method like so:

> function TMyApplication.ProcessAppMsg( var Message : TMsg ): boolean; virtual;
> begin
>   ProcessAppMsg := ProcessAccels( Message ) ;
> end ;

I am using a TDlgWindow object. This quick fix did the trick. Thanks! :)

Quote:
> Regards,

> Stephen Posey


Best Regards,
Scott McIntyre

======================================================================

  11400 ROBINWOOD DRIVE                PHONE: 301-790-2800 x327
  HAGERSTOWN MD 21742-6590 USA           FAX: 301-739-0737
======================================================================
              Home Page: http://www.western-md.com/hjc/
=============================================================



Wed, 18 Jun 1902 08:00:00 GMT  
 Minimize on Startup(Again)

Quote:

>Below is a snippit of code that I currently have in the Init section of my
>main application window object definitions.
>  constructor TMainWindow.Init(AParent: PWindowsObject; ATitle: PChar);
>  begin
>    if WinMinimized then
>      Attr.Param := Attr.Param or ws_Minimize;
>    TDlgWindow.Init(AParent, ATitle);
>  end;
>This doesn't work either, even after I did as you suggested. the WinMinimized
>flag is True if the application was iconized on termination. Otherwise it is
>False.
>> If your window is based on TDlgWindow then this is a known "bug" in
>> OWL where the ProcessAccels method of TApplication never gets called
>> because ProcessDlgMsg() is called first and it swallows the
>> accelerator messages; the simple solution is to override the
>> ProcessAppMsg() method like so:

>> function TMyApplication.ProcessAppMsg( var Message : TMsg ): boolean; virtual;
>> begin
>>   ProcessAppMsg := ProcessAccels( Message ) ;
>> end ;
>I am using a TDlgWindow object. This quick fix did the trick. Thanks! :)

I'm still investigating the WS_MINIMIZE situation, but I'd hate for
anybody to get stuck because of this, the proper override for the
TDlgWindow.ProccessAppMsg() method looks like:

function TMyDialog.ProcessAppMsg( var Message : TMsg ): boolean ;
begin
  ProcessAppMsg := ProcessAccels(Message) or ProcessDlgMsg(Message);
end ;

Regards,

Stephen Posey



Wed, 18 Jun 1902 08:00:00 GMT  
 Minimize on Startup(Again)

Quote:

> >> function TMyApplication.ProcessAppMsg( var Message : TMsg ): boolean; virtual;
> >> begin
> >>   ProcessAppMsg := ProcessAccels( Message ) ;
> >> end ;

> I'm still investigating the WS_MINIMIZE situation, but I'd hate for
> anybody to get stuck because of this, the proper override for the
> TDlgWindow.ProccessAppMsg() method looks like:

> function TMyDialog.ProcessAppMsg( var Message : TMsg ): boolean ;
> begin
>   ProcessAppMsg := ProcessAccels(Message) or ProcessDlgMsg(Message);
> end ;

> Regards,

> Stephen Posey


Hi Stephen,

I would beg forgiveness if I have inadvertently confused anyone in this
newsgroup regarding the use of ProcessAppMsg methods. Unfortunately, when I
tried to use this method in the TDlgWindow object and recompile, I got an
error. I then took a step back and placed it in the TApplication object.
I looked through the manuals but couldn't find the ProcessAppMsg method in
the TDlgWindow documentation.

Stephen, I would be very grateful if you could point me in the right
direction... or show me an example of how I can make it work. I am always
open to any constructive advice I can get concerning Borland Pascal.

BTW, I tried the FlashWindow() function and it worked just the way I had
hoped it would. I set up a timer to invert the icon and that did the job!
Thanks a million! :)

Please let me know if you find anything on the minimize on open or modifying
the application icon on the fly.

Best regards,

Scott McIntyre
Hagerstown Junior College

Web: http://www.western-md.com/hjc/



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

 Relevant Pages 

1. Minimize Main window on startup

2. Minimize on Startup / Unresponsive Accelerator Key

3. Run Minimized

4. DataSourceDataChange event fires when form is minimized?

5. Minimizing and Maximizing Delphi programs.

6. Minimizing Interbase Client/Server network traffic

7. Minimize application

8. HOW TO MINIMIZE PROGRAM MANAGER FROM WIN APPLICATION ?

9. Minimizing Windows

10. Minimizing to tray

11. Knowing when I am minimized

12. Win 3.11/Icon when minimized

 

 
Powered by phpBB® Forum Software