#pragma once
#ifndef __HWINDEF_H__
#define __HWINDEF_H__ 1
#pragma warning(disable:4996)
#define OEMRESOURCE
#include <SDKDDKVer.h>
#define SECURITY_WIN32
// Windows Header Files:
#include <windows.h>
#include <Windowsx.h>
#include <CommCtrl.h>
#include <Security.h>
#include <d2d1.h>
#include <dwrite.h>
#include <wincodec.h>
#include <Shobjidl.h>
#include <mshtml.h>
#include <OCIdl.h>
#include <OleDlg.h>
#include <CorError.h>
#include <algorithm>
#include <array>
#include <atomic>
#include <string>
#include <utility>
#include <memory>
#include <map>
#include <set>
#include <cmath>
#include <cfloat>
#include <iosfwd>
#include <regex>
#include <complex>
#include <unordered_map>
#include <wchar.h>
#include <boost/signals2/signal.hpp>
#ifdef HARLINNWINDOWS_EXPORTS
#define HWIN_EXPORT __declspec(dllexport)
#else
#define HWIN_EXPORT __declspec(dllimport)
#pragma comment(lib,"HarlinnWindowsLib")
#endif
namespace harlinn
{
namespace windows
{
typedef signed char Int8;
typedef signed char SByte;
typedef unsigned char UInt8;
typedef unsigned char Byte;
typedef short Int16;
typedef unsigned short UInt16;
typedef unsigned short ushort;
typedef int Int32;
typedef int Int;
typedef unsigned int UInt32;
typedef unsigned int UInt;
typedef unsigned long ULong32;
typedef long Long32;
typedef unsigned int uint;
typedef unsigned long DWord32;
typedef unsigned long DWord;
typedef long long Int64;
typedef long long Long64;
typedef long long LongLong;
typedef unsigned long long UInt64;
typedef unsigned long long ULong64;
typedef unsigned long long ULongLong;
typedef unsigned long DWord64;
typedef long long SSizeT;
typedef unsigned long long SizeT;
const UInt8 MaxUInt8 = ( ( UInt8 )~( ( UInt8 )0 ) );
const Int8 MaxInt8 = ( ( Int8 )( MaxUInt8 >> 1 ) );
const Int8 MinInt8 = ( ( Int8 )~MaxInt8 );
const UInt16 MaxUInt16 = ( ( UInt16 )~( ( UInt16 )0 ) );
const Int16 MaxInt16 = ( ( Int16 )( MaxUInt16 >> 1 ) );
const Int16 MinInt16 = ( ( Int16 )~MaxInt16 );
const UInt32 MaxUInt32 = ( ( UInt32 )~( ( UInt32 )0 ) );
const Int32 MaxInt32 = ( ( Int32 )( MaxUInt32 >> 1 ) );
const Int32 MinInt32 = ( ( Int32 )~MaxInt32 );
const UInt64 MaxUInt64 = ( ( UInt64 )~( ( UInt64 )0 ) );
const Int64 MaxInt64 = ( ( Int64 )( MaxUInt64 >> 1 ) );
const Int64 MinInt64 = ( ( Int64 )~MaxInt64 );
const ULong32 MaxULong32 = ( ( ULong32 )~( ( ULong32 )0 ) );
const Long32 MaxLong32 = ( ( Long32 )( MaxULong32 >> 1 ) );
const Long32 MinLong32 = ( ( Long32 )~MaxLong32 );
const ULong64 MaxULong64 = ( ( ULong64 )~( ( ULong64 )0 ) );
const Long64 MaxLong64 = ( ( Long64 )( MaxULong64 >> 1 ) );
const Long64 MinLong64 = ( ( Long64 )~MaxLong64 );
const ULongLong MaxULongLong = ( ( ULongLong )~( ( ULongLong )0 ) );
const LongLong MaxLongLong = ( ( LongLong )( MaxULongLong >> 1 ) );
const LongLong MinLongLong = ( ( LongLong )~MaxLongLong );
const SizeT MaxSizeT = ( ( SizeT )~( ( SizeT )0 ) );
const SSizeT MaxSSizeT = ( ( SSizeT )( MaxSizeT >> 1 ) );
const SSizeT MinSSizeT = ( ( SSizeT )~MaxSSizeT );
const UInt MaxUInt = ( ( UInt )~( ( UInt )0 ) );
const Int MaxInt = ( ( Int )( MaxUInt >> 1 ) );
const Int MinInt = ( ( Int )~MaxInt );
const DWord32 MaxDWord32 = ( ( DWord32 )~( ( DWord32 )0 ) );
const DWord64 MaxDWord64 = ( ( DWord64 )~( ( DWord64 )0 ) );
template<typename T>
inline bool InRange(const T& value,const T& minvalue, const T& maxValue)
{
return value >= minValue && value < maxValue;
}
template<typename T>
inline bool NotInRange(const T& value,const T& minvalue, const T& maxValue)
{
return value < minValue && value >= maxValue;
}
#define HWIN_STRING_IS_WIDE 1
class WideString;
class AnsiString;
#ifdef HWIN_STRING_IS_WIDE
typedef WideString String;
typedef wchar_t CharType;
#define HWIN_TEXT(quote) L##quote
#else
typedef AnsiString String;
typedef char CharType;
#define HWIN_TEXT(quote) quote
#endif
enum class SeekOrigin
{
StartOfFile = 0,
CurrentPosition = 1,
EndOfFile = 2
};
};
};
#define HWIN_DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE,INTTYPE) \
inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((INTTYPE) a) | ((INTTYPE) b)); } \
inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &) (((INTTYPE &) a) |= ((INTTYPE) b)); } \
inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((INTTYPE) a) & ((INTTYPE) b)); } \
inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &) (((INTTYPE &) a) &= ((INTTYPE) b)); } \
inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((INTTYPE) a)); } \
inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((INTTYPE) a) ^ ((INTTYPE) b)); } \
inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &) (((INTTYPE &) a) ^= ((INTTYPE) b)); }
#endif