⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resedit.asm

📁 这是用win32汇编编写的资源编辑器
💻 ASM
📖 第 1 页 / 共 5 页
字号:
               mov     Wth, eax
               mov     eax, Prect.top
               add     eax, 3
               sub     Prect.bottom, eax
             MOVmd     Hgt, Prect.bottom
               sub     Hgt, 21
            INVOKE     MoveWindow, hWnd, 0, 0, Prect.right, Prect.bottom, TRUE
            INVOKE     GetWindowRect, hWndStat, addr rect
               mov     ecx, rect.right
               sub     ecx, rect.left
               mov     edx, rect.bottom
               sub     edx, rect.top
            INVOKE     MoveWindow, hWndStat, 0, Hgt, ecx, edx, TRUE
               jmp     NoCheck
         .endif

         .if edx < 514 && !hAsmEdit         ; Height
            INVOKE     GetWindowRect, hWnd, addr rect
               mov     eax, rect.left
               sub     rect.right, eax
               mov     eax, rect.top
               add     eax, 542
               mov     rect.bottom, eax
            INVOKE     MoveWindow, hWnd, rect.left, rect.top, rect.right, 542, TRUE
               mov     edx, 514
               sub     edx, 20    ; Statusbar
               mov     Hgt, edx

         .elseif !hAsmEdit
               sub     edx, 20    ; Statusbar
               mov     Hgt, edx
         .endif

NoCheck:
         .if TabSelect == 2
            INVOKE     MoveWindow, hWork, 0, 0, Wth, Hgt, TRUE
            .if DlgOn
               INVOKE     GetWindowRect, hForm, addr Erect
                  mov     eax, Erect.left
                  sub     Erect.right, eax
                  mov     eax, Erect.top
                  sub     Erect.bottom, eax
               INVOKE     GetWindowRect, hwnd, addr rect
                  mov     eax, xOff
                  add     rect.left, eax
                  mov     eax, yOff
                  add     rect.top, eax
               INVOKE     MoveWindow, hForm, rect.left, rect.top, Erect.right, Erect.bottom, TRUE
               INVOKE     GetWindowRect, hForm, addr Erect
               INVOKE     GetWindowRect, hwnd, addr rect
                  mov     eax, Erect.left
                  sub     eax, rect.left
                  mov     xOff, eax
                  mov     eax, Erect.top
                  sub     eax, rect.top
                  mov     yOff, eax
            .endif

         .else
            INVOKE     MoveWindow, hREdit, 0, 0, Wth, Hgt, TRUE
         .endif

         INVOKE     GetWindowRect, hwnd, addr rect
            pop     ecx
            sub     rect.right, ecx
            mov     eax, ResB
            sub     rect.right, eax ;6
            mov     eax, ResT
            add     rect.top, eax ;22
         INVOKE     MoveWindow, hWndTab, Wth, 0, ecx, Hgt, TRUE

         .if hAsmEdit && hWndList
            .if Hgt < 479
                  sub     Hgt, 281 ;266
            .else
                  mov     Hgt, 198 ;213
            .endif
            INVOKE     MoveWindow, hWndList, 10, 239, 180, Hgt, TRUE ;213
         .endif

         INVOKE     ShowWindow, hWndTab, SW_SHOWDEFAULT
;         INVOKE     SetFocus, hMenuN
;INVOKE     SendMessage, hWndTab, WM_PAINT, 0, 0
INVOKE     UpdateWindow, hWndTab

      .elseif wmsg == WM_MOVE
         .if hAsmEdit
            INVOKE     GetWindowRect, hWnd, addr Prect
            .if Prect.top > 1000
                MOVmd     SavSelect, TabSelect
               .if TabSelect == 2
                     mov     sw2, 44
                  INVOKE     SendMessage, hTab, TCM_SETCURSEL, 0, 0
                     mov     nmhdr.code, TCN_SELCHANGE
                     lea     eax, nmhdr
                  INVOKE     SendMessage, hWndTab, WM_NOTIFY, 0, eax
                     jmp     Ret0
               .endif

            .elseif Prect.top < 1000
                  and     sw2, 0
               .if SavSelect == 2
                     mov     eax, ResB
                     add     FormX, eax ;6
                     mov     eax, ResT
                     add     FormY, eax ;22
               .endif
               INVOKE     SendMessage, hTab, TCM_SETCURSEL, SavSelect, 0
                  and     SavSelect, 0
                  mov     nmhdr.code, TCN_SELCHANGE
                  lea     eax, nmhdr
               INVOKE     SendMessage, hWndTab, WM_NOTIFY, 0, eax
            .endif
            INVOKE     GetClientRect, hAsmEdit, addr rect

         .else
            INVOKE     GetClientRect, hWnd, addr rect
         .endif
            mov     edx, rect.bottom
            shl     edx, 16
            mov     ecx, rect.right
            mov     dx, cx
         INVOKE     SendMessage, hWnd, WM_SIZE, 0, edx

      .elseif wmsg == WM_ACTIVATEAPP ;&& !hAsmEdit
         INVOKE     DefWindowProc, hWnd, WM_NCACTIVATE, wparam, 0 
            ret

      .elseif wmsg == WM_NCACTIVATE ;&& !hAsmEdit
            mov     eax, TRUE 
            ret

      .elseif wmsg == WM_COMMAND
            mov     eax, wparam
           cwde

         .if eax == IDM_CUT
            INVOKE     SendMessage, hREdit, WM_CUT, 0 ,0

         .elseif eax == IDM_COPY
            INVOKE     SendMessage, hREdit, WM_COPY, 0 ,0

         .elseif eax == IDM_PASTE
            INVOKE     SendMessage, hREdit, WM_PASTE, 0 ,0

         .elseif eax == IDM_DEL
            INVOKE     SendMessage, hREdit, WM_CLEAR, 0 ,0

         .elseif eax == IDM_SELALL
            INVOKE     SendMessage, hREdit, EM_SETSEL, 0, -1

         .endif

      .elseif wmsg == WM_CLOSE ;WM_DESTROY
         INVOKE     RegCreateKeyEx, HKEY_CURRENT_USER, addr szRedit, 0, addr szREGSZ, 0,\
                    KEY_WRITE or KEY_READ, 0, addr hReg, addr lpdwDisp
         INVOKE     RegSetValueEx, hReg, addr szGridOn, 0, REG_DWORD, addr GridOn, 4
         INVOKE     RegSetValueEx, hReg, addr szSnapOn, 0, REG_DWORD, addr SnapOn, 4
         INVOKE     RegSetValueEx, hReg, addr szGrid, 0, REG_DWORD, addr Grid, 4
         INVOKE     lstrlen, addr szResPath
            mov     lpcbData, eax
         INVOKE     RegSetValueEx, hReg, addr szResL, 0, REG_SZ, addr szResPath, lpcbData
         INVOKE     RegCloseKey, hReg

;         .if hAsmEdit && sw1 == 2244       ; Return from AsmEdit close Tab
;             jmp     GetOut
;         .endif

         .if hImage
            INVOKE     SendMessage, hImage, WM_COMMAND, 405, 0
         .endif
         .if hOpt
            INVOKE     SendMessage, hOpt, WM_CLOSE, 0, 0
         .endif
         .if hSizePos
            INVOKE     SendMessage, hSizePos, WM_CLOSE, 0, 0
         .endif
         .if hStyle
            INVOKE     StyleProc, hStyle, WM_COMMAND, 5006, 0
         .endif
         .if hIC
            INVOKE     DestroyIcon, hIC
               and     hIC, 0
         .endif

         .if RsrcInfo
            INVOKE     HeapFree, hDefHeap, 0, RsrcInfo
            INVOKE     HeapFree, hDefHeap, 0, RsrcInfoGrp
            INVOKE     HeapFree, hDefHeap, 0, MemRsrc
               and     RsrcInfo, 0
         .endif
         .if pMap
            INVOKE     UnmapViewOfFile, pMap
            INVOKE     CloseHandle, hMap
               and     pMap, 0
         .endif

            and     Len, 0
            mov     Cnt, 8
         .while (Cnt)
               mov     ecx, Len
            .if dword ptr Defines[ecx*4] != 0
               INVOKE     HeapFree, hDefHeap, 0, Defines[ecx*4]
                  mov     ecx, Len
                  mov     dword ptr Defines[ecx*4], 0
            .endif
               inc     Len
               dec     Cnt
         .endw

            and     Len, 0
            mov     Cnt, 30
         .while (Cnt)
               mov     ecx, Len
            .if dword ptr hDlgMem+[ecx*4] != 0
               INVOKE     HeapFree, hDefHeap, 0, dword ptr hDlgMem+[ecx*4]
                  mov     ecx, Len
                  mov     dword ptr hDlgMem+[ecx*4], 0
            .endif
               inc     Len
               dec     Cnt
         .endw

            INVOKE     DestroyWindow, hWndTool
         .if hAsmEdit  ; Calling programs parent
            INVOKE     BringWindowToTop, hAsmEdit
            INVOKE     SetFocus, hAsmEdit
         .endif

            and     Len, 0
            mov     Cnt, 18 ;20
         .while (Cnt)
               mov     eax, Len
            INVOKE     DeleteObject, hFont[eax*4]
               inc     Len
               dec     Cnt
         .endw

         INVOKE     DestroyCursor, hIcoR
         INVOKE     DestroyIcon, hIcon

         INVOKE     DestroyWindow, hSizeL
         INVOKE     DestroyWindow, hSizeT
         INVOKE     DestroyWindow, hSizeR
         INVOKE     DestroyWindow, hSizeB
         INVOKE     DestroyWindow, hWndStatic

         INVOKE     UnregisterClass, offset SizeClassV, hInst
         INVOKE     UnregisterClass, offset SizeClassH, hInst
         INVOKE     UnregisterClass, offset MultiClass, hInst

         .if hBRD
            INVOKE     DeleteObject, hBRD
         .endif
         .if hBR
            INVOKE     DeleteObject, hBR
         .endif
         .if hBRP
            INVOKE     DeleteObject, hBRP
         .endif
         .if hBRG
            INVOKE     DeleteObject, hBRG
         .endif
         .if hBRR
            INVOKE     DeleteObject, hBRR
         .endif

            and     Cnt, 0
         .while AniCnt
               mov     ecx, Cnt
            .if hAniArray+[ecx*4]
               INVOKE     DestroyWindow, hAniArray+[ecx*4]
            .endif
               inc     Cnt
               dec     AniCnt
         .endw

            and     Cnt, 0
         .while (ArrayCnt)
               mov     eax, Cnt
            .if hArray+[eax*8+4]                ; Check for valid handle
                  mov     edx, hArray+[eax*8+4] ; Extract handle
                  mov     ebx, hArray+[eax*8]   ; Extract array count type
                  and     ebx, 0ffffh
               .if ebx == 7501
                  INVOKE     DestroyWindow, edx
               .endif
            .endif
               inc     Cnt
               dec     ArrayCnt
         .endw

         .if hAsmEdit  ; Calling programs parent
               and     InputType, 0
               and     hUnder, 0
               and     DlgOn, 0
               and     CtrlOn, 0
               and     CtrlNum, 0
               and     IDCnt, 0
               mov     Dlg.ID, 2000
               mov     Dlg.StartID, 2001
and     hWork, 0
and     hGrp, 0
and     CtrlType, 0

            .if hForm
;               INVOKE     DestroyWindow, hForm
                  mov     ecx, hRetForm
                  xor     eax, eax
                  mov     [ecx], eax
                  and     hForm, 0
            .endif
            INVOKE     RtlZeroMemory, addr hDlgMem, 124
            INVOKE     RtlZeroMemory, addr hArray, 65544
            INVOKE     RtlZeroMemory, addr GrpCnt, 2576
            INVOKE     RtlZeroMemory, addr hDlg, 6152

               mov     ecx, 3333
            .if FromParent || sw1 != 2244
                  xor     ecx, ecx
            .endif
;            INVOKE     SendMessage, hParentA, WM_COMMAND, 6004, ecx

GetOut:
               mov     ecx, hRetParent
               xor     eax, eax
               mov     [ecx], eax

         .endif
         INVOKE     DestroyWindow, hwnd

      .elseif wmsg == WM_DESTROY
         INVOKE     PostQuitMessage, NULL

      .else

DefWin:
         INVOKE     DefWindowProc, hwnd, wmsg, wparam, lparam
            ret
      .endif

Ret0:
         xor    eax, eax
         ret
WndProc ENDP

;=====================================================
; Work window PROCEDURE
;=====================================================
WorkProc PROC  hwnd:DWORD, wmsg, wparam, lparam
LOCAL    Frect:RECT
LOCAL    Wrect:RECT

      .if wmsg == WM_LBUTTONDOWN && !DlgOn
            mov     CtrlType, 7501
         .if !hSizeData
            INVOKE     CreateDialogParam, hInst, 4902, hWnd, offset SizeDataProc, 0
         .endif
         INVOKE     GetClientRect, hwnd, addr Prect

            xor     ecx, ecx
            mov     eax, lparam
            mov     cx, ax
            shr     eax, 16
            mov     rect.left, ecx
            mov     rect.top, eax
            and     rect.right, 0
            and     rect.bottom, 0
         INVOKE     LoadGrabbers, hwnd
            xor     eax, eax
            ret

      .elseif wmsg == WM_MOUSEMOVE && DlgOn && hUnder && hForm && !hDef
         INVOKE     SetFocus, hForm

      .elseif wmsg == WM_MOUSEMOVE && !DlgOn

;---------- [Display the cursor x - y position] ----------
            mov     eax, lparam          ; Get the y   
            shr     eax,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -