; code snippet, this is all you need.. don't try to compile this shitty thingie ;)

; prototype
	MinimizeBitch PROTO :DWORD,:DWORD

    
; initialized data
    .data
	hidetray      db "Shell_TrayWnd",0
	hidedesk      db "progman",0

; temp stuff
    .data?
        temp          dd ?

; code ;)
    .code

	invoke EnumWindows,ADDR MinimizeBitch,SW_MINIMIZE

; minimize callback procedure..

MinimizeBitch proc hWnd:DWORD,lParam:DWORD
; check if the found window is visible
  invoke IsWindowVisible,hWnd
  test eax,eax
  jz _nomin
;Shell_TrayWnd and Progman -> big no no, don't minimize
  mov eax,hWnd
  mov temp,eax
  invoke FindWindow,offset hidetray,0
  cmp temp,eax
  je _nomin
  invoke FindWindow,offset hidedesk,0
  cmp temp,eax
  je _nomin
;Check for weird windows that aren't really visible at all..
;Normal windows are somewhere in 1xx and getright (weird) is in 10xxx or whatever
;I'm not really sure about this way of checking it's pretty weird, but hey... it seems
;to work just fine ;))
  invoke GetWindowLong,hWnd,GWL_EXSTYLE
  cmp eax, 1000
  jge _nomin
;Minimize the window
  invoke ShowWindow,hWnd,lParam
  _nomin:
  mov eax, TRUE
  ret
MinimizeBitch endp


; the end :) cya, Predator [PC/MFD]