(* OCaml-Win32
 * win32_error.ml
 * Copyright (c) 2002-2004 by Harry Chomsky
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *)

open Win32_core

(********************************************************************)
(* System Services: Debugging and Error Handling: SDK Documentation: Debugging and Error Handling: Error Handling *)

external beep : frequency:int -> duration:int -> unit = "beep"

external fatal_app_exit : message:string -> unit = "fatal_app_exit"

external flash_window : wnd:hwnd -> invert:bool -> bool = "flash_window"

(* ... language parameter *)
type format_message_source =
    Fms_string of string
  | Fms_hmodule of hinstance * int
  | Fms_system of int
type format_message_width =
    Fmw_none
  | Fmw_width of int
  | Fmw_max_width
type format_message_arg =
    Fma_int of int
  | Fma_char of char
  | Fma_string of string
external format_message :
    source:format_message_source ->
    width:format_message_width ->
    args:format_message_arg array option ->
    string = "format_message"

external get_last_error : unit -> error_code = "get_last_error"

external message_beep : beep_type:message_box_option option -> unit = "message_beep"

external set_error_mode : options:error_mode_option list -> error_mode_option list = "set_error_mode"

external set_last_error : code:error_code -> unit = "set_last_error"
