用过了。不错。asm写这么多,学习一下!
隐藏窗口如下:
枚举所有窗口,将句柄call back给00401A8F 处的函数:
004012E5 50 push eax
004012E6 68 8F1A4000 push Me.00401A8F
004012EB E8 D2090000 call <jmp.&user32.EnumWindows>
004012F0 59 pop ecx
处理获得的句柄:
00401A8F . 55 push ebp
00401A90 . 8BEC mov ebp,esp
00401A92 . 60 pushad
00401A93 . FF75 08 push dword ptr ss:[ebp+8] ; /hWnd
00401A96 . E8 5D020000 call <jmp.&user32.IsWindowVisible> ; \IsWindowVisible
00401A9B . 0BC0 or eax,eax
00401A9D . 0F84 86000000 je Me.00401B29
00401AA3 . 813D 103D4000 0001>cmp dword ptr ds:[403D10],100
00401AAD . 73 7A jnb short Me.00401B29
00401AAF . 68 04010000 push 104 ; /Count = 104 (260.)
00401AB4 . 68 043A4000 push Me.00403A04 ; |Buffer = Me.00403A04
00401AB9 . FF75 08 push dword ptr ss:[ebp+8] ; |hWnd
00401ABC . E8 0D020000 call <jmp.&user32.GetClassNameA> ; \GetClassNameA
00401AC1 . 68 49304000 push Me.00403049 ; /String2 = "Progman"
00401AC6 . 68 043A4000 push Me.00403A04 ; |String1 = ""
00401ACB . E8 B2020000 call <jmp.&kernel32.lstrcmpA> ; \lstrcmpA
00401AD0 . 0BC0 or eax,eax
00401AD2 . 75 04 jnz short Me.00401AD8
00401AD4 . EB 54 jmp short Me.00401B2A
00401AD6 . EB 15 jmp short Me.00401AED
00401AD8 > 68 51304000 push Me.00403051 ; /String2 = "Shell_TrayWnd"
00401ADD . 68 043A4000 push Me.00403A04 ; |String1 = ""
00401AE2 . E8 9B020000 call <jmp.&kernel32.lstrcmpA> ; \lstrcmpA
00401AE7 . 0BC0 or eax,eax
00401AE9 . 75 02 jnz short Me.00401AED
00401AEB . EB 3D jmp short Me.00401B2A
00401AED > E8 EE010000 call <jmp.&user32.GetForegroundWindow> ; [GetForegroundWindow
00401AF2 . 3B45 08 cmp eax,dword ptr ss:[ebp+8]
00401AF5 . 75 0E jnz short Me.00401B05
00401AF7 . 6A 00 push 0 ; /lParam = 0
00401AF9 . 6A 00 push 0 ; |wParam = 0
00401AFB . 6A 1C push 1C ; |Message = WM_ACTIVATEAPP
00401AFD . FF75 08 push dword ptr ss:[ebp+8] ; |hWnd
00401B00 . E8 35020000 call <jmp.&user32.SendMessageA> ; \SendMessageA
00401B05 > 6A 00 push 0 ; /ShowState = SW_HIDE
00401B07 . FF75 08 push dword ptr ss:[ebp+8] ; |hWnd
00401B0A . E8 3D020000 call <jmp.&user32.ShowWindow> ; \ShowWindow
00401B0F . FF75 08 push dword ptr ss:[ebp+8]
00401B12 . 8B45 0C mov eax,dword ptr ss:[ebp+C]
00401B15 . 0305 103D4000 add eax,dword ptr ds:[403D10]
00401B1B . 8F00 pop dword ptr ds:[eax]
00401B1D . 33DB xor ebx,ebx
00401B1F . 8958 04 mov dword ptr ds:[eax+4],ebx
00401B22 . 8305 103D4000 04 add dword ptr ds:[403D10],4
00401B29 > 61 popad
00401B2A > 8B45 08 mov eax,dword ptr ss:[ebp+8]
00401B2D . C9 leave
00401B2E . C2 0800 retn 8
大体就是瞅瞅类名,判断一下该窗口的属性等等,然后关键就是: invoke showwindow, hwnd, SW_HIDE
密码放在了注册表。用 RegisterHotKey 定义热键,没有用键盘钩子。别的没看。呵呵。
显示估计也是这样,重新show以下(猜的,没看,别骂偶)
你这个东西可以隐藏任务栏里的图标,不知道能不能隐藏托盘的图标?现在好像n多人想隐藏托盘。