Author:moonife
Don't haphazard use it: Assembly code(the code will safety return at most after two minute)
*****************************************************************
.386
.model flat,stdcall
option casemap:none
;****************************************************************
include windows.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
;****************************************************************
.data?
hwnd dd ?
hwdesk dd ?
mesg MSG <>
.const
szClassName db 'Progman',0
szCaptionMain db 'Program Manager',0
;****************************************************************
.code
start:
invoke FindWindow,addr szClassName,addr szCaptionMain
mov hwdesk,eax
invoke SetTimer,NULL,1,500,0
.while 1
invoke GetMessage,addr mesg,NULL,0,0
.if mesg.message==WM_TIMER
invoke GetForegroundWindow
.if eax!=hwdesk
mov hwnd,eax
invoke IsWindowVisible, hwnd
.if eax
invoke ShowWindow,hwnd,SW_HIDE
.endif
.endif
.endif
.endw
invoke KillTimer,NULL,1
invoke ExitProcess,NULL
end start
;****************************************************************
*****************************************************************
.386
.model flat,stdcall
option casemap:none
;****************************************************************
include windows.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
;****************************************************************
.data?
hwnd dd ?
hwdesk dd ?
mesg MSG <>
.const
szClassName db 'Progman',0
szCaptionMain db 'Program Manager',0
;****************************************************************
.code
start:
invoke FindWindow,addr szClassName,addr szCaptionMain
mov hwdesk,eax
invoke SetTimer,NULL,1,500,0
.while 1
invoke GetMessage,addr mesg,NULL,0,0
.if mesg.message==WM_TIMER
invoke GetForegroundWindow
.if eax!=hwdesk
mov hwnd,eax
invoke IsWindowVisible, hwnd
.if eax
invoke ShowWindow,hwnd,SW_HIDE
.endif
.endif
.endif
.endw
invoke KillTimer,NULL,1
invoke ExitProcess,NULL
end start
;****************************************************************
No comments:
Post a Comment