
Minimize on Startup / Unresponsive Accelerator Key
Quote:
>I am having two problems with my Borland Pascal 7.0 Win.
I'm assuming you're using OWL for this, my replies are based on that
assumption.
Quote:
>1) I a program that I am saving the main window state on exit
> (IE normal or iconized) and I want to restart the program with the
> main window in the same state as when the user left it. Nothing I
> have tried from the manuals has worked! :(
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.
Quote:
>2) I have accelerator keys defined in the resource file and I am
> loading them according to the documentation in the BP7 manuals.
> However, when I press any of the defined accelerator keys, nothing
> happens! :(
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 TMyDialog.ProcessAppMsg( var Message : TMsg ): boolean ;
begin
ProcessAppMsg :=
ProcessAccels( Message ) or
processDlgMsg( Message ) ;
end ;
Quote:
>I would greatly appreciate any suggestions any other pascal developer
>could give me.
>Thanks in advance for your help! :-))
Regards,
Stephen Posey