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

📄 win32汇编.txt

📁 会变语言实现的一些程序
💻 TXT
📖 第 1 页 / 共 4 页
字号:
                    .else
                          invoke  SetWindowPos,hWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE OR SWP_NOMOVE
                    .endif
              .elseif  ax==IDC_CHECK2
                    
                    invoke  IsDlgButtonChecked,hWnd,IDC_CHECK2
                    .if    eax==BST_CHECKED
                          invoke  GetDlgItem,hWnd,IDC_BITMAP
                          invoke  ShowWindow,eax,SW_SHOW
                    .else
                          invoke  GetDlgItem,hWnd,IDC_BITMAP
                          invoke  ShowWindow,eax,SW_HIDE
                    .endif
              .elseif  ax==IDC_RADIO1
                    invoke  GetDlgItem,hWnd,IDC_BUTTON1
                    invoke  ShowWindow,eax,SW_SHOW
              .elseif  ax==IDC_RADIO2
                    invoke  GetDlgItem,hWnd,IDC_BUTTON1
                    INVOKE  ShowWindow,eax,SW_HIDE
              .elseif  ax==IDC_EDIT1
                    invoke  GetDlgItemText,hWnd,IDC_EDIT1,addr szBuf,sizeof szBuf
                    invoke  SetWindowText,hWnd,addr szBuf
              .elseif  ax==IDC_COMBO1
                    shr    eax,16
                    .if    eax==CBN_SELENDOK
                          invoke  SendDlgItemMessage,hWnd,IDC_COMBO1,CB_GETCURSEL,0,0
                          mov    ebx,eax
                          invoke  SendDlgItemMessage,hWnd,IDC_COMBO1,CB_GETLBTEXT,eax,addr szBuf
                          invoke  SendDlgItemMessage,hWnd,IDC_COMBO1,CB_GETITEMDATA,ebx,0
                          .if    eax==3
                                invoke  SendDlgItemMessage,hWnd,IDC_EDIT1,EM_SETREADONLY,FALSE,0
                          .else
                                invoke  SetDlgItemText,hWnd,IDC_INFORMATION,addr szBuf
                                invoke  SetWindowText,hWnd,addr szBuf
                                invoke  SendDlgItemMessage,hWnd,IDC_EDIT1,EM_SETREADONLY,TRUE,0
                                invoke  SendDlgItemMessage,hWnd,IDC_COMBO1,CB_GETITEMDATA,ebx,0
                                invoke  SetDlgItemInt,hWnd,IDC_EDIT1,eax,FALSE
                                
                          .endif
                    .endif
              .elseif  ax==IDC_BUTTON1
                    mov    eax,hBit1
                    xchg    hBit2,eax
                    mov    hBit1,eax
                    invoke  SendDlgItemMessage,hWnd,IDC_BITMAP,STM_SETIMAGE,IMAGE_BITMAP,hBit1
              .elseif  ax==IDC_BUTTON2
                    invoke  DeleteObject,hBit1
                    invoke  DeleteObject,hBit2
                    invoke  EndDialog,hWnd,NULL
              .elseif  ax==IDC_BUTTON3
                    invoke  SendDlgItemMessage,hWnd,IDC_LIST2,LB_GETSELCOUNT,0,0
                    mov    @dwCount,eax
                    invoke  SendDlgItemMessage,hWnd,IDC_LIST2,LB_GETSELITEMS,50,addr szBuf2
                    invoke  lstrcpy,offset szBuf,offset szAll
                    mov    esi,offset szBuf2
                    cld
                    .while  @dwCount
                          lodsd
                          invoke  SendDlgItemMessage,hWnd,IDC_LIST2,LB_GETTEXT,eax,addr szBuf3
                          invoke  lstrcat,offset szBuf,offset szBuf3
                          invoke  lstrcat,offset szBuf,offset szEnter
                          dec  @dwCount
                    .endw
                    invoke  MessageBox,hWnd,addr szBuf,0,MB_OK
              .elseif  ax==IDC_BUTTON4
                    invoke  SendDlgItemMessage,hWnd,IDC_LIST2,LB_SETSEL,TRUE,-1
              .elseif  ax==IDC_LIST1
                    shr    eax,16
                    .if    eax==LBN_DBLCLK
                          invoke  SendDlgItemMessage,hWnd,IDC_LIST1,LB_GETCURSEL,0,0
                          invoke  SendDlgItemMessage,hWnd,IDC_LIST1,LB_GETTEXT,eax,addr szBuf
                          invoke  MessageBox,hWnd,addr szBuf,0,MB_OK
                    .elseif  eax==LBN_SELCHANGE
                          invoke  SendDlgItemMessage,hWnd,IDC_LIST1,LB_GETCURSEL,0,0
                          invoke  SendDlgItemMessage,hWnd,IDC_LIST1,LB_GETITEMDATA,eax,0
                          invoke  SetDlgItemInt,hWnd,IDC_INFORMATION,eax,FALSE
                    .endif
              .endif
        .elseif  eax==WM_HSCROLL
              invoke  KillTimer,hWnd,ID_TIME2
              mov    ebx,lParam
              invoke  GetDlgItem,hWnd,IDC_CUSTOM1
              .if    eax==ebx
                    mov    eax,wParam
                    .if    ax==SB_LINELEFT
                          dec  dwPos
                    .elseif  ax==SB_PAGELEFT
                          sub  dwPos,10
                    .elseif  ax==SB_LINERIGHT
                          inc  dwPos
                    .elseif  ax==SB_PAGERIGHT
                          add  dwPos,10
                    .elseif  ax==SB_THUMBPOSITION || ax==SB_THUMBTRACK
                          SHR  eax,16
                          mov  dwPos,eax
                    .endif
                    cmp  dwPos,0
                    jge  @F
                    mov  dwPos,0
                    @@:
                    cmp  dwPos,100
                    jle  @F
                    mov  dwPos,100
                    @@:
                    invoke  SendDlgItemMessage,hWnd,IDC_CUSTOM1,SBM_SETPOS,dwPos,TRUE
                    invoke  SetDlgItemInt,hWnd,IDC_NUM,dwPos,FALSE
              .endif
        .elseif  eax==WM_TIMER
              mov    eax,wParam
              .if    eax==ID_TIME1
                    invoke  GetLocalTime,offset stTime
                    movzx    eax,stTime.wHour
                    movzx    ebx,stTime.wMinute
                    movzx    ecx,stTime.wSecond
                    invoke  wsprintf,offset szBuf,offset szTimer,eax,ebx,ecx
                    invoke  SetDlgItemText,hWnd,IDC_INFORMATION,addr szBuf
              .elseif  eax==ID_TIME3
                    invoke  MessageBeep,MB_ABORTRETRYIGNORE
              .endif
        .elseif  eax==WM_CLOSE
              invoke  KillTimer,hWnd,ID_TIME1
              invoke  KillTimer,hWnd,ID_TIME3
              invoke  KillTimer,hWnd,ID_TIME2
              invoke  KillTimer,NULL,dwTime
              invoke  DeleteObject,hBit1
              invoke  DeleteObject,hBit2
              invoke  EndDialog,hWnd,NULL
        .else
              mov    eax,FALSE
              ret
        .endif
        mov    eax,TRUE
        ret
_diaProc    endp
_open      proc
        local  @st:OPENFILENAME
        invoke  RtlZeroMemory,addr @st,sizeof @st
        mov    @st.lStructSize,sizeof @st
        push    hWinMain
        pop    @st.hwndOwner
        mov    @st.Flags,OFN_FILEMUSTEXIST OR OFN_PATHMUSTEXIST
        mov    @st.lpstrFilter,offset szFilter
        mov    @st.lpstrFile,offset szFile
        mov    @st.nMaxFile,sizeof  szFile
        mov    @st.lpstrTitle,offset szAll
        invoke  GetOpenFileName,addr @st
        .if    eax
              invoke  MessageBox,hWinMain,addr szFile,0,MB_OK
        .endif
        ret
_open      endp
_save      proc
        LOCAL    @st:OPENFILENAME
        invoke  RtlZeroMemory,addr @st,sizeof @st
        mov    @st.lStructSize,sizeof @st
        push    hWinMain
        pop    @st.hwndOwner
        mov    @st.Flags,OFN_PATHMUSTEXIST
        mov    @st.lpstrFilter,offset szFilter
        mov    @st.lpstrFile,offset szFile
        mov    @st.nMaxFile,sizeof szFile
        mov    @st.lpstrDefExt,offset szDef
        invoke  GetSaveFileName,addr @st
        .if    eax
              invoke  MessageBox,hWinMain,addr szFile,0,MB_OK
        .endif
        ret
_save      endp
_font      proc
        local    @st:CHOOSEFONTA
        invoke  RtlZeroMemory,addr @st,sizeof @st
        mov    @st.lStructSize,sizeof @st
        push    hWinMain
        pop    @st.hwndOwner
        push    dwColor
        pop    @st.rgbColors
        mov    @st.Flags,CF_INITTOLOGFONTSTRUCT or CF_SCREENFONTS or CF_EFFECTS
        mov    @st.lpLogFont,offset stLogFONT
        invoke  ChooseFont,addr @st
        .if    eax
              mov  ebx,@st.iPointSize
              shl  ebx,1
              push  @st.rgbColors
              pop  dwColor
              invoke  wsprintf,offset szBuf,offset szFont,offset stLogFONT.lfFaceName,ebx,dwColor
              invoke  MessageBox,hWinMain,offset szBuf,0,MB_OK
        .endif
        ret
_font      endp
_color    proc
        local    @st:CHOOSECOLORA
        invoke  RtlZeroMemory,addr @st,sizeof @st
        mov    @st.lStructSize,sizeof @st
        push    hWinMain
        pop    @st.hwndOwner
        push    dwColor
        pop    @st.rgbResult
        mov    @st.lpCustColors,offset CustColor
        mov    @st.Flags,CC_RGBINIT or CC_FULLOPEN  
        invoke  ChooseColor,addr @st
        
        .if    eax
              push  @st.rgbResult
              pop  dwColor
              invoke  wsprintf,offset szBuf,offset szColor,dwColor
              invoke  MessageBox,hWinMain,offset szBuf,0,MB_OK
        .endif
        ret
_color    endp
_edit      proc  uses  ebx  esi edi hWnd,uMsg,wParam,lParam
        mov    eax,uMsg
        .if    eax==WM_CHAR
              mov  eax,wParam
              mov  edi,offset szChar
              cld
              mov  ecx,sizeof szChar
              repnz  scasb
              .if  ZERO?
                  cmp  al,'9'
                  jbe  @F
                  and  al,11011111B
                  @@:
                  invoke  CallWindowProc,lpOldProc,hWnd,uMsg,eax,lParam
              .endif
        .else
              invoke  CallWindowProc,lpOldProc,hWnd,uMsg,wParam,lParam
              ret
        .endif
        ret
_edit      endp
_diaProc2  proc  uses  ebx esi edi hWnd,uMsg,wParam,lParam
        mov    eax,uMsg
        .if    eax==WM_INITDIALOG
              invoke  GetDlgItem,hWnd,IDC_EDIT1
              mov    hEdit1,eax
              invoke  SetWindowLong,eax,GWL_WNDPROC,addr _edit
              mov    lpOldProc,eax
        .elseif  eax==WM_COMMAND
              mov    eax,wParam
              .if    !dwPos
                    mov  dwPos,0
                    .if    ax==IDC_EDIT1
                          ;invoke  _message,wParam
                    .elseif  ax==IDC_EDIT2
                          ;invoke  _message,wParam
                    .endif
                    inc  dwPos
              .endif
        .elseif  eax==WM_CLOSE
              invoke  EndDialog,hWnd,NULL
        .else
              mov    eax,FALSE
              RET
        .endif
        mov    eax,TRUE
        ret
_diaProc2  endp
        
_diaProc3  proc uses ebx esi edi hWnd,uMsg,wParam,lParam
        mov    eax,uMsg
        .if    eax==WM_INITDIALOG
              
        .elseif  eax==WM_CLOSE
              invoke  EndDialog,hWnd,NULL
        .else  
              mov  eax,FALSE
              ret

⌨️ 快捷键说明

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