--------------------------------------------------------------------
                      [BUG/PRB.] VFP 9.0 FIX - OPEN FILE OR SAVE FILE DIALOG BOX
                                 January 2024
                 --------------------------------------------------------------------
                                     CCB



1. BUG:

     In vfp9 (and vfp8), when we use the Open File or Save File Dialog Box,
     it only displays the title bar on Windows 10 Insider Preview Version 1903 Build 18290.

     The bug only occurs in vfp8 and vfp9, it does not occur in vfp6 and vfp7.

     The bug was reported by George Popescu.

     Please refer to the picture openfile9.png:


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Label81a2b5 ::
             push  dword ptr [ ebp + 080h ]                                  ;0x0081a2b5 :        ffb580000000
             call esi                                                        ;0x0081a2bb :        ffd6
             push eax                                                        ;0x0081a2bd :        50
             call edi                                                        ;0x0081a2be :        ffd7
             mov  eax , dword ptr [ ebp + 120 ]                              ;0x0081a2c0 :        8b4578
             sub  eax , dword ptr [ ebp + 100 ]                              ;0x0081a2c3 :        2b4564
             mov  ecx , dword ptr [ ebp + 108 ]                              ;0x0081a2c6 :        8b4d6c
             add  eax , dword ptr [ ebp + 124 ]                              ;0x0081a2c9 :        03457c
             sub  ecx , dword ptr [ ebp + 96 ]                               ;0x0081a2cc :        2b4d60
             pushd 015h                                                      ;0x0081a2cf :        6a15
             xor edx , edx                                                   ;0x0081a2d1 :        33d2
             push edx                                                        ;0x0081a2d3 :        52
             push edx                                                        ;0x0081a2d4 :        52
             push eax                                                        ;0x0081a2d5 :        50
             push ecx                                                        ;0x0081a2d6 :        51
             push edx                                                        ;0x0081a2d7 :        52
             pushd 04h                                                       ;0x0081a2d8 :        6a04
             push  dword ptr [ ebp + 0198h ]                                 ;0x0081a2da :        ffb598010000
             call esi                                                        ;0x0081a2e0 :        ffd6
             push eax                                                        ;0x0081a2e2 :        50
             call ebx                                                        ;0x0081a2e3 :        ffd3
             lea eax ,  dword ptr [ ebp + 108 ]                              ;0x0081a2e5 :        8d456c
             push eax                                                        ;0x0081a2e8 :        50
             push  dword ptr [ ebp + 080h ]                                  ;0x0081a2e9 :        ffb580000000
             call edi                                                        ;0x0081a2ef :        ffd7


     ;
     ;                 ---------------------------------------------------------
     ;                      VFP 9.0 FIX - OPEN FILE OR SAVE FILE DIALOG BOX
     ;                                  March 2019
     ;                 ---------------------------------------------------------
     ;                                     CCB
     ;
     ; The Open File or Save File Dialog Box only displays the title bar on Windows 10 Insider Preview Version 1903 Build 18290.
     ;
     ; 2019/3/10, by ccb
     ;

             pushd 02h
             push  dword ptr [ ebp + 0198h ]
             call esi
             test eax , eax
             je Label81a302
             push eax
             call IsWindow
             test eax , eax
             je Label81a302


             lea eax ,  dword ptr [ ebp + 76 ]                               ;0x0081a2f1 :        8d454c
             push eax                                                        ;0x0081a2f4 :        50
             pushd 02h                                                       ;0x0081a2f5 :        6a02
             push  dword ptr [ ebp + 0198h ]                                 ;0x0081a2f7 :        ffb598010000
             call esi                                                        ;0x0081a2fd :        ffd6
             push eax                                                        ;0x0081a2ff :        50
             call edi                                                        ;0x0081a300 :        ffd7

     Label81a302 ::
             mov  eax , dword ptr [ ebp + 88 ]                               ;0x0081a302 :        8b4558
             sub  eax , dword ptr [ ebp + 112 ]                              ;0x0081a305 :        2b4570
             pushd 016h                                                      ;0x0081a308 :        6a16
             add eax , 041h                                                  ;0x0081a30a :        83c041
             push eax                                                        ;0x0081a30d :        50
             mov  eax , dword ptr [ ebp + 116 ]                              ;0x0081a30e :        8b4574
             sub  eax , dword ptr [ ebp + 108 ]                              ;0x0081a311 :        2b456c
             push eax                                                        ;0x0081a314 :        50
             xor eax , eax                                                   ;0x0081a315 :        33c0
             push eax                                                        ;0x0081a317 :        50
             push eax                                                        ;0x0081a318 :        50
             push eax                                                        ;0x0081a319 :        50
             push  dword ptr [ ebp + 080h ]                                  ;0x0081a31a :        ffb580000000
             call ebx                                                        ;0x0081a320 :        ffd3

     Now in VFP Advanced, the Open File or Save File Dialog Box displays well on Windows 10 Insider Preview Version 1903 Build 18290.

     Please refer to the picture openfile.png:


4. APPLIES TO:

     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.

     IMPORTANT NOTE FOR WINDOWS 10:
     The bug only occurs on Windows 10 Insider Preview Version 1903 Build 18290 (November 28, 2018),
     it does not occur on Windows 10 Version 1903 Build 18362 (April 4, 2019) or later,
     so recommend to upgrade to Windows 10 Version 1903 Build 18362 (April 4, 2019) or later.


5. REFERENCE WEBSITES:

     1, baiyujia.com:
     http://www.baiyujia.com

     2, profox.ro:
     http://www.profox.ro/Forum/tabid/55/forumid/3/threadid/49582/scope/posts/Default.aspx


6. OTHER:

     For reference only, there is no guarantees.

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