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

📄 enabler.asm

📁 用汇编程序编写
💻 ASM
字号:
; Author: Deuce
; Enables all child windows belonging to the foreground window.

.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

DlgProc proto :DWORD,:DWORD,:DWORD,:DWORD
EnableAll proto :DWORD, :DWORD

.const
ENABLER                    equ     101
ICON                       equ     102
IDC_HANDLE                 equ     1002
IDC_ENABLE                 equ     1001
TIMERID                    equ     WM_USER

.data
template db '%lX',0
posBuffer db 10 dup (0)

.code
start:
	invoke	GetModuleHandle,NULL
	invoke	DialogBoxParam,eax,ENABLER,NULL,offset DlgProc,NULL
	invoke	ExitProcess,eax

DlgProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

	cmp	uMsg,WM_TIMER                                   ;It's been 200 ms, enumerate the windows again!
	je	getPoint
	cmp	uMsg,WM_INITDIALOG                              ;Initialization stuff
	je	boxStart
	cmp	uMsg,WM_CLOSE
	je	boxClose

  retFalse:
	mov	eax,FALSE
	ret

  boxStart:
	invoke	SetTimer,hWnd,TIMERID,200,NULL                  ;Start up the timer for 200 ms intervals
	jmp	retTrue

  boxClose:
	invoke	KillTimer,hWnd,TIMERID                          ;Okay we're done so shut everything down
	invoke	EndDialog,hWnd,NULL
	jmp	retTrue

  getPoint:
	invoke	IsDlgButtonChecked,hWnd,IDC_ENABLE              ;Are we activated?
	cmp	eax,BST_CHECKED
	jne	retTrue

	invoke	GetForegroundWindow                             ;Yep, what window is activated?

	push	eax
	invoke	wsprintf,offset posBuffer,offset template,eax   ;Translate handle value to ASCII
	invoke	SetDlgItemText,hWnd,IDC_HANDLE,offset posBuffer ;Set the handle edit box
	pop	eax

	invoke	EnumChildWindows,eax,offset EnableAll,NULL      ;Now we are gonna filter through all child windows
  retTrue:
	mov	eax,TRUE
	ret

DlgProc endp
EnableAll proc hWnd:HWND,lParam:LPARAM                          ;Windows sends the handle of each child window here
	invoke	IsWindowEnabled,hWnd                            ;Is this child window enabled or not?
	cmp	eax,TRUE
	je	getNext

	invoke	EnableWindow,hWnd,TRUE                          ;No, it's not! So we'll enable it :)

      invoke      IsWindowVisible,hWnd                          ;is showwindow ok?
      cmp   eax,TRUE
      je    getNext
      
      invoke      ShowWindow,hWnd,TRUE
      invoke	EnableWindow,hWnd,TRUE 
           
  getNext:
	mov	eax,TRUE                                        ;Return TRUE to get handle of next child window
	ret
EnableAll endp
end	start

⌨️ 快捷键说明

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