EnableExplicit

Procedure ExitWindowsDialog(hWnd.i)
  Define.i xLong1
  Define.i xLong2

  xLong1 = GetModuleHandle_(@"shell32.dll")
  If Not xLong1
    xLong1 = LoadLibrary_(@"shell32.dll")
    EndIf
  If xLong1
    ; internal name, should be exported with xp sp3 and newer... but still isn't or not working
    xLong2 = GetProcAddress(xLong1, "ShutDownDialog")
    If Not xLong2
      xLong2 = GetProcAddress_(xLong1, 60)
      EndIf
    If xLong2
      If IsMinWindows7
        CallFunctionFast(xLong2, hWnd, 0)
        Else
        CallFunctionFast(xLong2, hWnd)
        EndIf
      EndIf
    EndIf
  EndProcedure

; IDE Options = PureBasic 5.21 LTS (Windows - x86)
; CursorPosition = 8
; FirstLine = 1
; Folding = -
; EnableUnicode
; EnableXP