---------------------------------------------------------------------------------------------
                      [NEW.....] VFP 9.0 FIX - THE NEW ACCESS KEYS FOR THE MENU ITEMS INDENT AND UNINDENT
                                  March 2024
                 ---------------------------------------------------------------------------------------------
                                     CCB



1. THE ACCESS KEYS IN EDITOR (from dv_foxhelp9.chm):

     Visual FoxPro Advanced (10.0.0.0) Language Reference.
     Keyboard Shortcuts

     Visual FoxPro supports keyboard shortcuts in these areas: 
     Browse window
     Class Browser
     Code window
     Controls
     Editor
     Form Designer and Class Designer
     Help
     Menu commands
     Print Preview window
     Properties window
     Report Designer and Label Designer
     Window manipulation

     Visual FoxPro supports the following keyboard shortcuts in Editor:
     ---------------------------------------------------------------------------------------------------------------
     | Shortcut             | Action                                                                               |
     ---------------------------------------------------------------------------------------------------------------
     | ALT+Drag             | Cuts and pastes.                                                                     |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+Drag            | Copies and pastes.                                                                   |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+I               | Show IntelliSense Quick Info.                                                        |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+J               | Show IntelliSense List Members or List Values.                                       |
     ---------------------------------------------------------------------------------------------------------------
     | F2                   | Moves to the line containing the next bookmark.                                      |
     ---------------------------------------------------------------------------------------------------------------
     | SHIFT+F2             | Moves to the line containing the previous bookmark.                                  |
     ---------------------------------------------------------------------------------------------------------------
     | ALT+SHIFT+F2         | Toggles a bookmark for the current line on and off.                                  |
     ---------------------------------------------------------------------------------------------------------------
     | F3                   | Finds the next occurrence of the specified text.                                     |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+F3 or CTRL+G    | Finds the next occurrence of the selected text.                                      |
     ---------------------------------------------------------------------------------------------------------------
     | SHIFT+F3             | Finds the previous occurrence of the specified text.                                 |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+SHIFT+F3        | Finds the previous occurrence of the selected text.                                  |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+DOWNARROW       | Scrolls window up without moving cursor.                                             |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+UPARROW         | Scrolls window down without moving cursor.                                           |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+LEFTARROW       | Moves the cursor one word to the left.                                               |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+RIGHTARROW      | Moves the cursor one word to the right.                                              |
     ---------------------------------------------------------------------------------------------------------------
     | F9                   | Inserts or removes a breakpoint.                                                     |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+F9              | Enables or disables a breakpoint.                                                    |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+B               | Brings up Breakpoints dialog box.                                                    |
     ---------------------------------------------------------------------------------------------------------------
     | ALT+F2               | Adds/Removes Task List shortcut.                                                     |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+U               | Makes the selection all lowercase.                                                   |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+SHIFT+U         | Makes the selection all uppercase.                                                   |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+BACKSPACE       | Deletes a word to the left.                                                          |
     ---------------------------------------------------------------------------------------------------------------

     Visual FoxPro Advanced supports the following keyboard shortcuts in Editor:
     ---------------------------------------------------------------------------------------------------------------
     | Shortcut             | Action                                                                               |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL++               | Enlarge font (only in VFP Advanced IDE and VFP Advanced Runtime).                    |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+-               | Reduce font (only in VFP Advanced IDE and VFP Advanced Runtime).                     |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+]               | Indent (only in VFP Advanced IDE and VFP Advanced Runtime).                          |
     ---------------------------------------------------------------------------------------------------------------
     | CTRL+[               | Unindent (only in VFP Advanced IDE and VFP Advanced Runtime).                        |
     ---------------------------------------------------------------------------------------------------------------
     NOTE: We can use these keyboard shortcuts in Editor if the Format menu is shown.
     We can't use these keyboard shortcuts in Editor if the Format menu is not shown, for example,
     MODIFY COMMAND ... NOMENU && there is no the Format menu.
     MODIFY FILE ... NOMENU    && there is no the Format menu.
     MODIFY MEMO ... NOMENU    && there is no the Format menu.

     The suggestion comes from Eric Selje and Douglas Sanchez Guillen.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Fun415b39 :: ; proc near
             push ebx                                                        ;0x00415b39 :        53
             mov  ebx , dword ptr [ esp + 8 ]                                ;0x00415b3a :        8b5c2408
             push ebp                                                        ;0x00415b3e :        55
             mov  ebp , dword ptr [ esp + 20 ]                               ;0x00415b3f :        8b6c2414
             push esi                                                        ;0x00415b43 :        56
             mov esi , eax                                                   ;0x00415b44 :        8bf0
             push edi                                                        ;0x00415b46 :        57
             mov edx , ebx                                                   ;0x00415b47 :        8bd3
             mov ecx , esi                                                   ;0x00415b49 :        8bce
             call Fun43de2a                                                  ;0x00415b4b :        e8da820200
             mov edx , eax                                                   ;0x00415b50 :        8bd0
             xor eax , eax                                                   ;0x00415b52 :        33c0
             mov ecx , 016h                                                  ;0x00415b54 :        b916000000
             mov edi , edx                                                   ;0x00415b59 :        8bfa
             rep stosd                                                       ;0x00415b5b :        f3ab
             stosb                                                           ;0x00415b5d :        aa
             mov  ax , word ptr [ ebp + 2 ]                                  ;0x00415b5e :        668b4502
             or edi , 0FFFFFFFFh                                             ;0x00415b62 :        83cfff
             cmp ax , di                                                     ;0x00415b65 :        663bc7
             je Label483e17                                                  ;0x00415b68 :        0f84a9e20600
             movsx ecx , ax                                                  ;0x00415b6e :        0fbfc8
             mov  dword ptr [ esp + 28 ] , ecx                               ;0x00415b71 :        894c241c

     Label415b75 ::
             mov  eax , dword ptr [ esp + 28 ]                               ;0x00415b75 :        8b44241c
             mov  dword ptr [edx] , eax                                      ;0x00415b79 :        8902
             movsx ecx ,word ptr [ ebp + 0 ]                                 ;0x00415b7b :        0fbf4d00
             mov  dword ptr [ edx + 4 ] , ecx                                ;0x00415b7f :        894a04
             mov  dword ptr [ edx + 32 ] , edi                               ;0x00415b82 :        897a20
             mov  al , byte ptr [ ebp + 12 ]                                 ;0x00415b85 :        8a450c
             mov  byte ptr [ edx + 54 ] , al                                 ;0x00415b88 :        884236
             mov  cx , word ptr [ ebp + 14 ]                                 ;0x00415b8b :        668b4d0e
             mov  eax , dword ptr [ edx + 4 ]                                ;0x00415b8f :        8b4204
             or eax , 0200h                                                  ;0x00415b92 :        0d00020000
             mov  word ptr [ edx + 55 ] , cx                                 ;0x00415b97 :        66894a37
             mov  dword ptr [ edx + 40 ] , edi                               ;0x00415b9b :        897a28
             mov  word ptr [ edx + 65 ] , di                                 ;0x00415b9e :        66897a41
             mov  word ptr [ edx + 50 ] , di                                 ;0x00415ba2 :        66897a32
             mov  word ptr [ edx + 69 ] , di                                 ;0x00415ba6 :        66897a45
             mov  dword ptr [ edx + 4 ] , eax                                ;0x00415baa :        894204
             mov ecx , eax                                                   ;0x00415bad :        8bc8
             mov  ax , word ptr [ ebp + 16 ]                                 ;0x00415baf :        668b4510


     ;
     ;                 ----------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE NEW ACCESS KEYS FOR THE MENU ITEMS INDENT AND UNINDENT
     ;                                  March 2024
     ;                 ----------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; The new access keys for the menu items "Indent" (Ctrl+]) and "Unindent" (Ctrl+[).
     ;
     ; 2024/3/1, by ccb
     ;

             cmp dword ptr vfpa_sys9152_data,00h
             je Label415bb3_unindent_end

     Label415bb3_indent_start:
             cmp dword ptr [edx] , 0FFFFB509h
             jne Label415bb3_indent_end
             mov ax , 201Dh
             mov  word ptr [ edx + 63 ] , ax
             jmp Label415b21
     Label415bb3_indent_end:

     Label415bb3_unindent_start:
             cmp dword ptr [edx] , 0FFFFB50Ah
             jne Label415bb3_unindent_end
             mov ax , 201Bh
             mov  word ptr [ edx + 63 ] , ax
             jmp Label415b21
     Label415bb3_unindent_end:


     Label415bb3 ::
             test ax , ax                                                    ;0x00415bb3 :        6685c0
             mov  word ptr [ edx + 63 ] , ax                                 ;0x00415bb6 :        6689423f
             jne Label415b21                                                 ;0x00415bba :        0f8561ffffff

     Label415bc0 ::
             mov  ax , word ptr [ ebp + 10 ]                                 ;0x00415bc0 :        668b450a
             cmp ax , di                                                     ;0x00415bc4 :        663bc7
             jne Label5a1809                                                 ;0x00415bc7 :        0f853cbc1800

     Label415bcd ::
             mov  ax , word ptr [ ebp + 6 ]                                  ;0x00415bcd :        668b4506
             test ax , ax                                                    ;0x00415bd1 :        6685c0
             jne Label5a1824                                                 ;0x00415bd4 :        0f854abc1800
             cmp  word ptr [ ebp + 8 ] , ax                                  ;0x00415bda :        66394508
             jne Label5a1824                                                 ;0x00415bde :        0f8540bc1800

     Label415be4 ::
             mov  ax , word ptr [ ebp + 4 ]                                  ;0x00415be4 :        668b4504
             test ax , ax                                                    ;0x00415be8 :        6685c0
             jne Label41825c                                                 ;0x00415beb :        0f856b260000

     Label415bf1 ::
             movzx ebx ,word ptr [ ebp + 34 ]                                ;0x00415bf1 :        0fb75d22
             movsx eax ,word ptr [ ebp + 26 ]                                ;0x00415bf5 :        0fbf451a
             add ebx , ebp                                                   ;0x00415bf9 :        03dd
             cmp eax , 0FFFFFFFFh                                            ;0x00415bfb :        83f8ff
             je Label415c24                                                  ;0x00415bfe :        7424
             add eax , ebx                                                   ;0x00415c00 :        03c3
             mov ecx , eax                                                   ;0x00415c02 :        8bc8
             lea edi ,  dword ptr [ ecx + 1 ]                                ;0x00415c04 :        8d7901
             lea ebx ,  dword ptr [ebx]                                      ;0x00415c07 :        8d1b

     Label415c09 ::
             mov  dl , byte ptr [ecx]                                        ;0x00415c09 :        8a11
             inc ecx                                                         ;0x00415c0b :        41
             test dl , dl                                                    ;0x00415c0c :        84d2
             jne Label415c09                                                 ;0x00415c0e :        75f9
             sub ecx , edi                                                   ;0x00415c10 :        2bcf
             test ecx , ecx                                                  ;0x00415c12 :        85c9
             jle Label415c24                                                 ;0x00415c14 :        7e0e
             mov  edx , dword ptr [ esp + 20 ]                               ;0x00415c16 :        8b542414
             push ecx                                                        ;0x00415c1a :        51
             pushd 017h                                                      ;0x00415c1b :        6a17
             push edx                                                        ;0x00415c1d :        52
             push esi                                                        ;0x00415c1e :        56
             call Fun43120e                                                  ;0x00415c1f :        e8eab50100

     Label415c24 ::


     ;
     ;                 ----------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE NEW ACCESS KEYS FOR THE MENU ITEMS INDENT AND UNINDENT
     ;                                  March 2024
     ;                 ----------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; The new access keys for the menu items "Indent" (Ctrl+]) and "Unindent" (Ctrl+[).
     ;
     ; 2024/3/1, by ccb
     ;

             cmp dword ptr vfpa_sys9152_data,00h
             je Label415c24_unindent_end2

             mov edx , dword ptr [ esp + 20 ]
             mov ecx , esi
             call Fun43de2a
             mov edx , eax

     Label415c24_indent_start2:
             cmp dword ptr [edx] , 0FFFFB509h
             jne Label415c24_indent_end2
             call vfpa_getlanguage
             cmp ax , "68"
             je Label415c24_indent_chs
             cmp ax , "88"
             je Label415c24_indent_cht
             cmp ax , "93"
             je Label415c24_indent_csy
             cmp ax , "84"
             je Label415c24_indent_deu
             cmp ax , "00"
             je Label415c24_indent_enu
             cmp ax , "43"
             je Label415c24_indent_esn
             cmp ax , "33"
             je Label415c24_indent_fra
             cmp ax , "55"
             je Label415c24_indent_kor
             cmp ax , "70"
             je Label415c24_indent_rus
             jmp Label415c24_indent_other
     Label415c24_indent_chs:
             mov eax , offset vfpa_indent_key_chs
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_cht:
             mov eax , offset vfpa_indent_key_cht
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_csy:
             mov eax , offset vfpa_indent_key_csy
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_deu:
             mov eax , offset vfpa_indent_key_deu
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_enu:
             mov eax , offset vfpa_indent_key_enu
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_esn:
             mov eax , offset vfpa_indent_key_esn
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_fra:
             mov eax , offset vfpa_indent_key_fra
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_kor:
             mov eax , offset vfpa_indent_key_kor
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_rus:
             mov eax , offset vfpa_indent_key_rus
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_other:
             mov eax , offset vfpa_indent_key_other
             mov ecx , 06h
             jmp Label417892
     Label415c24_indent_end2:

     Label415c24_unindent_start2:
             cmp dword ptr [edx] , 0FFFFB50Ah
             jne Label415c24_unindent_end2
             call vfpa_getlanguage
             cmp ax , "68"
             je Label415c24_unindent_chs
             cmp ax , "88"
             je Label415c24_unindent_cht
             cmp ax , "93"
             je Label415c24_unindent_csy
             cmp ax , "84"
             je Label415c24_unindent_deu
             cmp ax , "00"
             je Label415c24_unindent_enu
             cmp ax , "43"
             je Label415c24_unindent_esn
             cmp ax , "33"
             je Label415c24_unindent_fra
             cmp ax , "55"
             je Label415c24_unindent_kor
             cmp ax , "70"
             je Label415c24_unindent_rus
             jmp Label415c24_unindent_other
     Label415c24_unindent_chs:
             mov eax , offset vfpa_unindent_key_chs
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_cht:
             mov eax , offset vfpa_unindent_key_cht
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_csy:
             mov eax , offset vfpa_unindent_key_csy
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_deu:
             mov eax , offset vfpa_unindent_key_deu
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_enu:
             mov eax , offset vfpa_unindent_key_enu
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_esn:
             mov eax , offset vfpa_unindent_key_esn
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_fra:
             mov eax , offset vfpa_unindent_key_fra
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_kor:
             mov eax , offset vfpa_unindent_key_kor
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_rus:
             mov eax , offset vfpa_unindent_key_rus
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_other:
             mov eax , offset vfpa_unindent_key_other
             mov ecx , 06h
             jmp Label417892
     Label415c24_unindent_end2:


     Label415c25 ::
             movsx eax ,word ptr [ ebp + 22 ]                                ;0x00415c24 :        0fbf4516
             cmp eax , 0FFFFFFFFh                                            ;0x00415c28 :        83f8ff
             jne Label41787a                                                 ;0x00415c2b :        0f85491c0000

     Label415c31 ::
             movsx eax ,word ptr [ ebp + 24 ]                                ;0x00415c31 :        0fbf4518
             cmp eax , 0FFFFFFFFh                                            ;0x00415c35 :        83f8ff
             je Label415c5c                                                  ;0x00415c38 :        7422
             add eax , ebx                                                   ;0x00415c3a :        03c3
             mov ecx , eax                                                   ;0x00415c3c :        8bc8
             lea edi ,  dword ptr [ ecx + 1 ]                                ;0x00415c3e :        8d7901

     Label415c41 ::
             mov  dl , byte ptr [ecx]                                        ;0x00415c41 :        8a11
             inc ecx                                                         ;0x00415c43 :        41
             test dl , dl                                                    ;0x00415c44 :        84d2
             jne Label415c41                                                 ;0x00415c46 :        75f9
             sub ecx , edi                                                   ;0x00415c48 :        2bcf
             test ecx , ecx                                                  ;0x00415c4a :        85c9
             jle Label415c5c                                                 ;0x00415c4c :        7e0e
             mov  edx , dword ptr [ esp + 20 ]                               ;0x00415c4e :        8b542414
             push ecx                                                        ;0x00415c52 :        51
             pushd 02h                                                       ;0x00415c53 :        6a02
             push edx                                                        ;0x00415c55 :        52
             push esi                                                        ;0x00415c56 :        56
             call Fun43120e                                                  ;0x00415c57 :        e8b2b50100

     Label415c5c ::
             movsx eax ,word ptr [ ebp + 18 ]                                ;0x00415c5c :        0fbf4512
             cmp eax , 0FFFFFFFFh                                            ;0x00415c60 :        83f8ff
             jne Label5a1839                                                 ;0x00415c63 :        0f85d0bb1800

     Label415c69 ::
             movsx eax ,word ptr [ ebp + 20 ]                                ;0x00415c69 :        0fbf4514
             cmp eax , 0FFFFFFFFh                                            ;0x00415c6d :        83f8ff
             jne Label5a1864                                                 ;0x00415c70 :        0f85eebb1800

     Label415c76 ::
             test  byte ptr [ ebp + 0 ] , 04h                                ;0x00415c76 :        f6450004
             jne Label415c96                                                 ;0x00415c7a :        751a
             mov  eax , dword ptr [ ebp + 28 ]                               ;0x00415c7c :        8b451c
             mov  ecx , dword ptr [ esp + 20 ]                               ;0x00415c7f :        8b4c2414
             pushd 04h                                                       ;0x00415c83 :        6a04
             pushd 03h                                                       ;0x00415c85 :        6a03
             push ecx                                                        ;0x00415c87 :        51
             mov  dword ptr [ esp + 36 ] , eax                               ;0x00415c88 :        89442424
             push esi                                                        ;0x00415c8c :        56
             lea eax ,  dword ptr [ esp + 40 ]                               ;0x00415c8d :        8d442428
             call Fun43120e                                                  ;0x00415c91 :        e878b50100

     Label415c96 ::
             mov  eax , dword ptr [esi]                                      ;0x00415c96 :        8b06
             mov  edx , dword ptr [ esp + 20 ]                               ;0x00415c98 :        8b542414
             inc edx                                                         ;0x00415c9c :        42
             mov  dword ptr [ eax + 64 ] , edx                               ;0x00415c9d :        895040
             mov  ecx , dword ptr [esi]                                      ;0x00415ca0 :        8b0e
             mov eax , edx                                                   ;0x00415ca2 :        8bc2
             mov  dword ptr [ ecx + 0ECh ] , eax                             ;0x00415ca4 :        8981ec000000
             mov  edx , dword ptr [esi]                                      ;0x00415caa :        8b16
             mov  ecx , dword ptr [ esp + 28 ]                               ;0x00415cac :        8b4c241c
             mov  dword ptr [ edx + 68 ] , eax                               ;0x00415cb0 :        894244
             mov  eax , dword ptr [esi]                                      ;0x00415cb3 :        8b06
             mov  ebp , dword ptr [ eax + 12 ]                               ;0x00415cb5 :        8b680c
             push ecx                                                        ;0x00415cb8 :        51
             lea edx ,  dword ptr [ esp + 24 ]                               ;0x00415cb9 :        8d542418
             or ebp , 080000000h                                             ;0x00415cbd :        81cd00000080
             push edx                                                        ;0x00415cc3 :        52
             mov  dword ptr [ eax + 12 ] , ebp                               ;0x00415cc4 :        89680c
             call Fun415a13                                                  ;0x00415cc7 :        e847fdffff
             test eax , eax                                                  ;0x00415ccc :        85c0
             je Label415cdf                                                  ;0x00415cce :        740f
             mov  eax , dword ptr [esi]                                      ;0x00415cd0 :        8b06
             mov  ecx , dword ptr [ eax + 8 ]                                ;0x00415cd2 :        8b4808
             cmp  ecx , dword ptr [ esp + 20 ]                               ;0x00415cd5 :        3b4c2414
             jne Label40b8ef                                                 ;0x00415cd9 :        0f85105cffff

     Label415cdf ::
             pop edi                                                         ;0x00415cdf :        5f
             pop esi                                                         ;0x00415ce0 :        5e
             pop ebp                                                         ;0x00415ce1 :        5d
             pop ebx                                                         ;0x00415ce2 :        5b
             ret 0Ch                                                         ;0x00415ce3 :        c20c00


4. APPLIES TO:

     VFP 10 (VFP Advanced)


5. REFERENCE WEBSITES:

     1, baiyujia.com:
     http://www.baiyujia.com
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix317.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix92.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix155.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix156.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix308.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix316.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix318.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix352.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix353.asp


6. OTHER:

     For reference only, there is no guarantees.

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