Minimize on Startup / Unresponsive Accelerator Key 
Author Message
 Minimize on Startup / Unresponsive Accelerator Key

I am having two problems with my Borland Pascal 7.0 Win.

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! :(

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! :(

I would greatly appreciate any suggestions any other pascal developer
could give me.

Thanks in advance for your help! :-))



Wed, 18 Jun 1902 08:00:00 GMT  
 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



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

 Relevant Pages 

1. Minimize Main window on startup

2. Minimize on Startup(Again)

3. Delphi Accelerator Key Problem

4. Sybase 11 NT server becoming unresponsive

5. Question on internet accelerator / preloader

6. Run Minimized

7. DataSourceDataChange event fires when form is minimized?

8. Minimizing and Maximizing Delphi programs.

9. Minimizing Interbase Client/Server network traffic

10. Minimize application

11. HOW TO MINIMIZE PROGRAM MANAGER FROM WIN APPLICATION ?

12. Minimizing Windows

 

 
Powered by phpBB® Forum Software