29 #define WIN32_LEAN_AND_MEAN 30 #define WIN32_EXTRA_LEAN 31 #define WIN32_NO_STATUS 33 #define COM_NO_WINDOWS_H 42 #if defined(UNICODE) && !defined(_UNICODE) 62 #pragma warning(disable: 4786) // disable warnings about too long debug information symbols 74 #define _MAX_FNAME 256 75 #define _MAX_DIR _MAX_FNAME 76 #define _MAX_EXT _MAX_FNAME 80 #define W_VER_NT 0 // constant for HIWORD(GetVersion())>>14 88 #define for if (0) {} else for 91 #define COUNTOF _countof 93 #define COUNTOF(x) (sizeof(x)/sizeof(x[0])) 97 #define BUFFER_LEN 2048 102 #define LOG(txt) _log_(txt) 106 #define LONGLONGARG TEXT("I64") 108 #define LONGLONGARG TEXT("L") 114 #define _tcsrchr wcsrchr 116 #define _tcsrchr strrchr 122 #define _stprintf wcsprintf 124 #define _stprintf sprintf 128 #define U2A(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, -1, d, l, NULL, NULL) 129 #define U2nA(s, d, l) WideCharToMultiByte(CP_ACP, 0, s, l, d, l, NULL, NULL) 130 #define A2U(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, -1, d, l) 131 #define A2nU(s, d, l) MultiByteToWideChar(CP_ACP, 0, s, l, d, l) 140 #define _tcsnicmp strncasecmp 141 #define _tcsicoll strcasecmp 144 #ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 145 #define FILE_ATTRIBUTE_ENCRYPTED 0x00000040 146 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 147 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 148 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 152 #define SetDlgCtrlID(hwnd, id) SetWindowLongPtr(hwnd, GWL_ID, id) 153 #define SetWindowStyle(hwnd, val) (DWORD)SetWindowLongPtr(hwnd, GWL_STYLE, val) 154 #define SetWindowExStyle(h, val) (DWORD)SetWindowLongPtr(hwnd, GWL_EXSTYLE, val) 155 #define Window_SetIcon(hwnd, type, hicon) (HICON)SendMessage(hwnd, WM_SETICON, type, (LPARAM)(hicon)) 193 #if defined(__STDC_WANT_SECURE_LIB__) && defined(_MS_VER) // for VS 2005: _MSC_VER>=1400 195 #define _stprintf_s1 _stprintf_s 196 #define _stprintf_s2 _stprintf_s 198 #else // __STDC_WANT_SECURE_LIB__ 200 #define strcpy_s(d, l, s) strcpy(d, s) 201 #define wcscpy_s(d, l, s) wcscpy(d, s) 202 #define wcsncpy_s(d, l, s, n) wcsncpy(d, s, n) 204 #if defined(_tcscpy) && !defined(_tcscpy_s) 205 #define _tcscpy_s(d, l, s) _tcscpy(d, s) 208 #if defined(_tsplitpath) && !defined(_tsplitpath_s) 209 #define _tsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _tsplitpath(f, d, p, n, e) 211 #define _wsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _wsplitpath(f, d, p, n, e) 212 #define _splitpath_s(f, d,dl, p,pl, n,nl, e,el) _splitpath(f, d, p, n, e) 215 #define _stprintf_s1(b, l, f, p1) _stprintf(b, f, p1) 216 #define _stprintf_s2(b, l, f, p1,p2) _stprintf(b, f, p1,p2) 218 #endif // __STDC_WANT_SECURE_LIB__ 232 #if _MSC_VER>=1300 // VS.Net 237 #if defined(_MSC_VER) && !defined(_NO_COMUTIL) 243 #endif // _MSC_VER && !_NO_COMUTIL 251 #define launch_fileA launch_file 262 struct CommonControlInit
298 operator HWND()
const {
return _hwnd;}
307 struct HiddenWindow :
public WindowHandle
345 : _crit_sect(crit_sect)
406 virtual int Run() = 0;
408 bool is_alive()
const {
return _alive;}
425 struct ClientRect :
public RECT 432 operator LPRECT() {
return this;}
438 struct WindowRect :
public RECT 445 operator LPRECT() {
return this;}
466 operator LPPOINT() {
return this;}
509 operator HDC()
const {
return hdc;}
520 operator HDC() {
return _hdc;}
527 struct WindowCanvas :
public Canvas
532 ~WindowCanvas() {
ReleaseDC(_hwnd, _hdc);}
542 struct MemCanvas :
public Canvas
551 struct SelectedBitmap
564 struct BufferCanvas :
public MemCanvas
566 BufferCanvas(
HDC hdc,
int x,
int y,
int w,
int h)
567 : MemCanvas(
hdc), _hdctarg(
hdc),
568 _x(
x), _y(
y), _w(
w), _h(
h),
572 : MemCanvas(
hdc), _hdctarg(
hdc),
583 struct BufferedCanvas :
public BufferCanvas
591 ~BufferedCanvas() {
BitBlt(_hdctarg,
_x, _y, _w, _h, _hdc, 0, 0, _mode);}
597 struct BufferedPaintCanvas :
public PaintCanvas,
public BufferedCanvas
605 operator HDC() {
return BufferedCanvas::_hdc;}
625 BkMode(
HDC hdc,
int bkmode)
628 ~BkMode() {
SetBkMode(_hdc, _old_bkmode);}
641 ~FontSelection() {
SelectFont(_hdc, _old_hFont);}
649 struct BitmapSelection
662 struct BrushSelection
664 BrushSelection(
HDC hdc, HBRUSH hBrush)
667 ~BrushSelection() {
SelectBrush(_hdc, _old_hBrush);}
690 operator HMENU() {
return _hmenu;}
730 struct Variant :
public VARIANT 737 operator long()
const;
738 operator bool()
const;
785 operator BSTR()
const 787 return _p? _p: (
BSTR)
L"";
809 typedef wstring super;
811 typedef string super;
829 void assign(
const BStr&
s) {
int l =
s.length(); super::assign(
s,
l);}
840 String& operator=(
const BStr&
s) {assign(
s);
return *
this;}
842 String& operator=(
LPCTSTR s) {
if (
s) super::assign(
s);
else erase();
return *
this;}
843 String& operator=(
const super&
s) {super::assign(
s);
return *
this;}
844 void assign(
LPCTSTR s) {super::assign(
s);}
845 void assign(
LPCTSTR s,
int l) {super::assign(
s,
l);}
847 operator LPCTSTR()
const {
return c_str();}
906 #define _STRING_DEFINED 909 struct FmtString :
public String 946 #define UNC(x) ((LPCWSTR)(x)) 950 #define ANS(x) ((LPCSTR)(x)) 982 template<
typename FCT>
struct DynamicFct
999 operator bool()
const {
return _fct?
true:
false;}
1007 template<
typename FCT>
struct DynamicLoadLibFct
1009 DynamicLoadLibFct(
LPCTSTR moduleName,
UINT ordinal)
1023 ~DynamicLoadLibFct()
1029 operator bool()
const {
return _fct?
true:
false;}
1078 String getStackTrace()
const;
1092 #define CONTEXT_OBJ __ctx__._obj 1093 #define CONTEXT(c) Context __ctx__(c) 1094 #define CURRENT_CONTEXT Context::current() 1095 #define OBJ_CONTEXT(c, o) Context __ctx__(c, o) 1101 #endif // __cplusplus
void CenterWindow(HWND hwnd)
void _wsplitpath(const WCHAR *path, WCHAR *drv, WCHAR *dir, WCHAR *name, WCHAR *ext)
GLubyte GLubyte GLubyte GLubyte w
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
complex< _Tp > _STLP_CALL operator *(const _Tp &__x, const complex< _Tp > &__z)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WideCharToMultiByte
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
HDC WINAPI GetDC(_In_opt_ HWND)
ACPI_SIZE strlen(const char *String)
static CRITICAL_SECTION CritSect
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
void display_error(HWND hwnd, DWORD error)
#define INVALID_HANDLE_VALUE
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLint GLint GLint GLint GLint x
_CRTIMP void __cdecl _splitpath(_In_z_ const char *_FullPath, _Pre_maybenull_ _Post_z_ char *_Drive, _Pre_maybenull_ _Post_z_ char *_Dir, _Pre_maybenull_ _Post_z_ char *_Filename, _Pre_maybenull_ _Post_z_ char *_Ext)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static BOOL Append(LPWSTR *ppszText, DWORD *pdwTextLen, LPCWSTR pszAppendText, DWORD dwAppendLen)
String get_windows_version_str()
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
void WINAPI VariantInit(VARIANTARG *pVarg)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static void append(struct dump_context *dc, const void *data, unsigned size)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
BOOL RegSetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD value)
GLfloat GLfloat GLfloat GLfloat h
_In_ PVOID _Out_ BOOLEAN * Stop
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
#define ICC_TREEVIEW_CLASSES
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static UINT WPARAM LPARAM lparam
BOOL launch_cpanel(HWND hwnd, LPCTSTR applet)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
GLenum GLuint GLenum GLsizei length
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
BSTR WINAPI SysAllocString(LPCOLESTR str)
BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow)
typedef bool(CARDLIBPROC *pCanDragProc)(CardRegion &stackobj
bitset< _Nb > _STLP_CALL operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y)
GLboolean GLboolean GLboolean b
_Check_return_opt_ _CRTIMP int __cdecl vprintf(_In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
struct task_struct * current
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
void MoveVisible(HWND hwnd)
#define SelectFont(hdc, hfont)
BOOL WINAPI DestroyMenu(_In_ HMENU)
__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ICC_LISTVIEW_CLASSES
BOOL exists_path(LPCTSTR path)
BOOL WINAPI DeleteDC(_In_ HDC)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define SelectBitmap(hdc, hbm)
GLint GLint GLint GLint GLint GLint y
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define MultiByteToWideChar
#define ICC_PROGRESS_CLASS
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HMENU WINAPI CreatePopupMenu(void)
int find_window_class(LPCTSTR classname)
struct tagContext Context
DWORD WINAPI ThreadProc(LPVOID lpParam)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define GetProcAddress(x, y)
#define SelectBrush(hdc, hbr)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
GLdouble GLdouble GLdouble GLdouble top
DWORD RegGetDWORDValue(HKEY root, LPCTSTR path, LPCTSTR valueName, DWORD def)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
BOOL time_to_filetime(const time_t *t, FILETIME *ftime)
BOOL RecursiveCreateDirectory(LPCTSTR path_in)
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
bool SplitFileSysURL(LPCTSTR url, String &dir_out, String &fname_out)