########################################################################
# Module     : hwindows.hsm
# Description: Windows-constants.
# Maintainer : Juergen Haible <juergen.haible@t-online.de>
#              Heiko Studt <Heiko.Studt@gmx.de>
# Version    : 2002-04-07
########################################################################
# NOTE:
# This module is delivered with Hamster and it will be overwritten when
# installing a new version of it. It might also be used by accompanying
# demo-scripts, which depend on the current implementation.
# So do NOT change this file unless you REALLY know what you do!
########################################################################

#!initialize

debug( 255, "<<< module 'hwindows.hsm' >>>" )

   ## MsgBox-Style/Buttons
   Const ( $MB_OK,                        0x00000)
   Const ( $MB_OKCANCEL,                  0x00001)
   Const ( $MB_ABORTRETRYIGNORE,          0x00002)
   Const ( $MB_YESNOCANCEL,               0x00003)
   Const ( $MB_YESNO,                     0x00004)
   Const ( $MB_RETRYCANCEL,               0x00005)

   ## MsgBox-Style/Icons
   Const ( $MB_ICONHAND,                  0x00010)
   Const ( $MB_ICONERROR,                 0x00010)
   Const ( $MB_ICONSTOP,                  0x00010)
   Const ( $MB_ICONQUESTION,              0x00020)
   Const ( $MB_ICONEXCLAMATION,           0x00030)
   Const ( $MB_ICONWARNING,               0x00030)
   Const ( $MB_ICONASTERISK,              0x00040)
   Const ( $MB_ICONINFORMATION,           0x00040)
   Const ( $MB_USERICON,                  0x00080)

   ## MsgBox-Style/Special
   Const ( $MB_APPLMODAL,                 0x00000)
   Const ( $MB_SYSTEMMODAL,               0x01000)
   Const ( $MB_TASKMODAL,                 0x02000)
   Const ( $MB_HELP,                      0x04000)
   Const ( $MB_NOFOCUS,                   0x08000)
   Const ( $MB_SETFOREGROUND,             0x10000)
   Const ( $MB_DEFAULT_DESKTOP_ONLY,      0x20000)
   Const ( $MB_TOPMOST,                   0x40000)
   Const ( $MB_RIGHT,                     0x80000)

   ## MsgBox-Style/Default
   Const ( $MB_DEFBUTTON1       , 0x00000000 )
   Const ( $MB_DEFBUTTON2       , 0x00000100 )
   Const ( $MB_DEFBUTTON3       , 0x00000200 )
   Const ( $MB_DEFBUTTON4       , 0x00000300 )

   ## MsgBox-Results:
   Const ( $IDOK     , 1 )
   Const ( $IDCANCEL , 2 )
   Const ( $IDABORT  , 3 )
   Const ( $IDRETRY  , 4 )
   Const ( $IDIGNORE , 5 )
   Const ( $IDYES    , 6 )
   Const ( $IDNO     , 7 )
   
   ## Execute()-showmodes:
   Const ( $SW_HIDE          , 0 )
   Const ( $SW_SHOWNORMAL    , 1 )
   Const ( $SW_SHOWMINIMIZED , 2 )
   Const ( $SW_SHOWMAXIMIZED , 3 )
    
   ## Beep()-Options
   Const ( $SIGNAL_STOP        , 0x10 )
   Const ( $SIGNAL_QUESTION    , 0x20 )
   Const ( $SIGNAL_EXCLAMATION , 0x30 )
   Const ( $SIGNAL_ASTERISK    , 0x40 )

   ## ScriptPriority()-Values
   Const ( $THREAD_PRIORITY_IDLE         , 0 )
   Const ( $THREAD_PRIORITY_LOWEST       , 1 )
   Const ( $THREAD_PRIORITY_BELOW_NORMAL , 2 )
   Const ( $THREAD_PRIORITY_NORMAL       , 3 )
   Const ( $THREAD_PRIORITY_ABOVE_NORMAL , 4 )
   Const ( $THREAD_PRIORITY_HIGHEST      , 5 )
   Const ( $THREAD_PRIORITY_TIME_CRITICAL, 6 )

return( 0 )
  
sub RasErrText( $code )
  Varset ( $ps, MemAlloc(256) )
  DllCall( "rasapi32.dll|RasGetErrorStringA|n|nnn", $code, $ps, 256 )
  Const ( $Result, MemGetStr($ps) )
  MemFree( $ps )
  return( $Result )
endsub  