------------------------------------------------------------------------
                      VFP 9.0 FIX - MAXIMIZE THE REPORT PREVIEW WINDOW AUTOMATICALLY
                                 January 2019
                 ------------------------------------------------------------------------
                                     CCB



1. BUG:

     In vfp9 (and vfp6, vfp7, vfp8), it will ALWAYS show the report preview window in its current size and position.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Label492880 ::
             mov  eax , dword ptr [ ebp + 018Ch ]                            ;0x00492880 :        8b858c010000
             mov  dword ptr [ ebp - 112 ] , eax                              ;0x00492886 :        894590
             mov  eax , dword ptr [ ebp + 0188h ]                            ;0x00492889 :        8b8588010000
             xor edx , edx                                                   ;0x0049288f :        33d2
             lea ecx ,  dword ptr [ ebp - 128 ]                              ;0x00492891 :        8d4d80
             mov  dword ptr [ ebp - 108 ] , edi                              ;0x00492894 :        897d94
             mov  dword ptr [ ebp - 44 ] , eax                               ;0x00492897 :        8945d4
             mov  dword ptr [ ebp - 104 ] , 08Ch                             ;0x0049289a :        c745988c000000
             mov  dword ptr [ ebp - 100 ] , 0B4h                             ;0x004928a1 :        c7459cb4000000
             call Fun42ef1e                                                  ;0x004928a8 :        e871c6f9ff
             mov esi , eax                                                   ;0x004928ad :        8bf0
             test esi , esi                                                  ;0x004928af :        85f6
             je Label55d3e3                                                  ;0x004928b1 :        0f842cab0c00


     ;
     ;                  ------------------------------------------------------------------------
     ;                       VFP 9.0 FIX - MAXIMIZE THE REPORT PREVIEW WINDOW AUTOMATICALLY
     ;                                 October 2018
     ;                  ------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, it will ALWAYS show the report preview window in its current size and position.
     ; In VFP Advanced, it can enable or disable maximize the report preview window automatically.
     ;
     ; 2018/10/14, by ccb
     ;

             cmp dword ptr vfpa_report_isreportform,00h
             je Label4928b7
             cmp  byte ptr [ Data93c280 ] , 05Ah
             jae Label4928b7
             mov  ecx , dword ptr [eax]
             mov  ecx , dword ptr [ecx]
             mov dword ptr vfpa_maximizereport_hwnd,ecx


     Label4928b7 ::
             mov  dword ptr [ ebx + 12 ] , esi                               ;0x004928b7 :        89730c
             mov  dword ptr [ ebx + 8 ] , esi                                ;0x004928ba :        897308
             call Fun544102                                                  ;0x004928bd :        e840180b00
             test eax , eax                                                  ;0x004928c2 :        85c0
             mov edi , offset Label62699c                                              ;0x004928c4 :        bf9c696200
             je Label4928d0                                                  ;0x004928c9 :        7405
             mov  eax , dword ptr [eax]                                      ;0x004928cb :        8b00
             mov  dword ptr [ eax + 28 ] , edi                               ;0x004928cd :        89781c

     Now In VFP Advanced, it can enable or disable maximize the report preview window automatically.


4. APPLIES TO:

     VFP 6.0.8167.0
     VFP 6.0.8961.0 (SP5)

     VFP 7.0.0.9262
     VFP 7.0.0.9465 (SP1)

     VFP 8.0.0.2521
     VFP 8.0.0.3117 (SP1)

     VFP 9.0.0.2412
     VFP 9.0.0.3504 (SP1)
     VFP 9.0.0.4611 (SP2)
     VFP 9.0.0.5015 (SP2)
     VFP 9.0.0.5411 (SP2)
     VFP 9.0.0.5721 (SP2)
     VFP 9.0.0.5815 (SP2)
     VFP 9.0.0.6303 (SP2)
     VFP 9.0.0.6602 (SP2)
     VFP 9.0.0.7423 (SP2)

     The bug has been fixed in VFP Advanced.


5. REFERENCE WEBSITES:

     1, baiyujia.com:
     http://www.baiyujia.com
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix54.asp

     2, microsoft.com:
     https://social.msdn.microsoft.com/forums/en-US/be708920-dc67-4eae-81e5-94348c4b046d/how-to-get-the-report-preview-in-full-screen-

     3, foxite.com:
     https://www.foxite.com/archives/how-to-maximize-report-window-0000272164.htm
     https://www.foxite.com/archives/report-maximize-0000320497.htm

     4, narkive.com:
     https://microsoft.public.fox.helpwanted.narkive.com/pJgPB3g8/how-to-set-the-default-report-preview-window-size

     5, experts-exchange.com:
     https://www.experts-exchange.com/questions/25812148/Report-Listner-for-VFP-9.html

     6, tek-tips.com:
     https://www.tek-tips.com/viewthread.cfm?qid=851476


6. OTHER:

     For reference only, there is no guarantees.

     Any questions or suggestions, please send me an email at ccb2000@163.com.