FEMM/compat/afxwin.h

107 lines
3.2 KiB
C++

// MFC widget skeletons so GUI headers parse without dragging in real MFC.
#pragma once
#include "afx.h"
typedef unsigned int UINT;
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
typedef long LONG;
typedef void* HCURSOR;
typedef void* HICON;
typedef void* HWND;
typedef void* HINSTANCE;
typedef void* HANDLE;
typedef int LPCRECT;
typedef const char* LPCSTR;
typedef const char* LPCTSTR;
typedef char* LPSTR;
typedef char* PSTR;
typedef const char* PCSTR;
typedef DWORD COLORREF;
typedef unsigned long WPARAM;
typedef long LPARAM;
typedef long LRESULT;
struct CPoint { int x = 0, y = 0; CPoint() = default; CPoint(int a, int b) : x(a), y(b) {} };
struct CRect { int left = 0, top = 0, right = 0, bottom = 0; };
struct CSize { int cx = 0, cy = 0; };
struct MSG { HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; CPoint pt; };
#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)) | ((WORD)((BYTE)(g))<<8) | ((DWORD)((BYTE)(b))<<16)))
#define PM_REMOVE 1
#define PM_NOREMOVE 0
#define MB_ICONEXCLAMATION 0x30
#define MB_OK 0
#define VK_ESCAPE 0x1B
#define WM_PAINT 0x000F
#define WM_CHAR 0x0102
#define WM_CLOSE 0x0010
#define WM_RBUTTONUP 0x0205
#define WM_KEYDOWN 0x0100
#define WM_KEYUP 0x0101
#define WM_LBUTTONDOWN 0x0201
#define WM_LBUTTONUP 0x0202
#define WM_QUIT 0x0012
inline int PeekMessage(MSG*, HWND, UINT, UINT, UINT) { return 0; }
inline int TranslateMessage(const MSG*) { return 0; }
inline long DispatchMessage(const MSG*) { return 0; }
inline int MessageBox(HWND, const char*, const char*, UINT) { return 0; }
inline int GetAsyncKeyState(int) { return 0; }
inline int MessageBeep(UINT) { return 0; }
#define afx_msg
#define DECLARE_MESSAGE_MAP()
#define BEGIN_MESSAGE_MAP(...)
#define END_MESSAGE_MAP()
#define ON_COMMAND(...)
#define ON_WM_PAINT()
#define ON_WM_CHAR()
#define ON_WM_RBUTTONUP()
#define ON_WM_CLOSE()
#define ON_BN_CLICKED(...)
#define DECLARE_DYNCREATE(x)
#define IMPLEMENT_DYNCREATE(...)
#define DECLARE_DYNAMIC(x)
#define IMPLEMENT_DYNAMIC(...)
class CObject {};
class CCmdTarget : public CObject {};
class CWnd : public CCmdTarget {
public:
void* m_hWnd = nullptr;
int SetDlgItemText(int, const char*) { return 0; }
int SetWindowText(const char*) { return 0; }
int UpdateWindow() { return 0; }
int InvalidateRect(void* = nullptr, int = 1) { return 1; }
};
class CDialog : public CWnd {
public:
CDialog(int = 0, CWnd* = nullptr) {}
virtual int DoModal() { return 0; }
virtual void OnOK() {}
virtual void OnCancel() {}
virtual int OnInitDialog() { return 1; }
};
class CEdit : public CWnd {
public:
int Create(unsigned long, const CRect&, CWnd*, unsigned int) { return 0; }
void SetSel(int, int, int = 0) {}
};
class CProgressCtrl : public CWnd { public: void SetPos(int) {} };
class CButton : public CWnd {};
class CStatic : public CWnd {};
class CComboBox : public CWnd {};
class CListBox : public CWnd {};
class CTreeCtrl : public CWnd {};
class CTabCtrl : public CWnd {};
class CDataExchange {};