EnableExplicit

#FILE_READ      = $80000000
#FILE_WRITE     = $40000000
#FILE_READWRITE = $C0000000

#CP_ACP = 0
#CP_UTF8 = 65001
#CP_WINUNICODE = 1200

#OFN_ENABLESIZING = $800000

#TPM_TOPALIGN      = $0;
#TPM_VCENTERALIGN  = $10;
#TPM_BOTTOMALIGN   = $20;
#TPM_NONOTIFY      = $80
#TPM_RETURNCMD     = $100
#TPM_HORIZONTAL    = $0;
#TPM_VERTICAL      = $40;
#TPM_RECURSE       = $1;
#TPM_PopupMenuRecommend = #TPM_RETURNCMD | #TPM_NONOTIFY | #TPM_RIGHTBUTTON

Macro CreateFile_CreateWO(Filename)
  CreateFile_(Filename, #FILE_WRITE, $1, 0, #CREATE_ALWAYS, $20, 0)
  EndMacro

Macro CreateFile_CreateRW(Filename)
  CreateFile_(Filename, #FILE_READWRITE, $1, 0, #CREATE_ALWAYS, $20, 0)
  EndMacro

Macro CreateFile_OpenRO(Filename)
  CreateFile_(Filename, #FILE_READ, $1, 0, #OPEN_EXISTING, $20, 0)
  EndMacro

Macro CreateFile_OpenRW(Filename)
  CreateFile_(Filename, #FILE_READWRITE, $1, 0, #OPEN_EXISTING, $20, 0)
  EndMacro

Macro DragQueryFileCount(hDrop)
  DragQueryFile_(hDrop, -1, 0, 0)
  EndMacro

Macro DrawText(hdc, lpStr, lpRect, wFormat)
  DrawText_(hdc, @lpStr, Len(lpStr), lpRect, wFormat)
  EndMacro

Macro UnregisterClass(lpClassName)
  UnregisterClass_(lpClassName, hInstance)
  EndMacro

Macro LoadResEx_Menu(MenuID)
  LoadMenu_(hInstance, MenuID)
  EndMacro

Macro TextOut0(hdc, xString)
  TextOut_(hdc, 0, 0, @xString, Len(xString))
  EndMacro

Macro TextOutXY(hdc, xString, PosX, PosY)
  TextOut_(hdc, PosX, PosY, @xString, Len(xString))
  EndMacro

Macro CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent)
  CreateWindowEx_(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, 0, hInstance, 0)
  EndMacro

CompilerIf #PB_Compiler_Unicode
  Macro RegSetValueEx_String(HKEY, lpValueName, lpString)
    RegSetValueEx_(HKEY, lpValueName, 0, 1, lpString, (Len(lpString) + 1) << 1)
    EndMacro
  CompilerElse
  Macro RegSetValueEx_String(HKEY, lpValueName, lpString)
    ProcedureReturn RegSetValueEx_(HKEY, lpValueName, 0, 1, lpString, Len(lpString) + 1)
    EndMacro
  CompilerEndIf

Macro WindowFromPoint_Point(xType1)
  WindowFromPoint_(PeekQ(@xType1))
  EndMacro

Macro WindowFromPoint_XY(X, Y)
  WindowFromPoint_((Y << 32) | (X & $ffffffff))
  EndMacro

; IDE Options = PureBasic 5.21 LTS (Windows - x64)
; CursorPosition = 10
; Folding = ---
; EnableUnicode
; EnableXP