⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lguibase.h

📁 详细的MiniGUI源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
typedef struct _MSG {     // msg 	HWND	hWnd;     	UINT	message; 	WPARAM	wParam; 	LPARAM	lParam; 	void*	pData;} MSG;typedef MSG* PMSG;typedef struct _NtfMsgLink{	MSG		msg;	struct _NtfMsgLink* pNext;} NtfMsgLink;typedef NtfMsgLink* PNtfMsgLink;typedef struct _SyncMsgLink{	MSG		msg;	int		iRetValue;	sem_t	sem;	struct _SyncMsgLink* pNext;} SyncMsgLink;typedef SyncMsgLink* PSyncMsgLink;typedef struct _WndMailBox{	MSG			msg[SIZE_WND_MAILBOX];	int			iReadPos;	int			iWritePos;} WndMailBox;typedef WndMailBox* PWndMailBox;typedef struct _MsgQueue{	pthread_mutex_t 	mutex;       	sem_t			sem;  	DWORD			dwState;                       	PSyncMsgLink		pHeadSyncMsg;	PSyncMsgLink		pTailSyncMsg;	PNtfMsgLink		pHeadNtfMsg;	PNtfMsgLink		pTailNtfMsg;	PNtfMsgLink		pHeadPntMsg;	PNtfMsgLink		pTailPntMsg;	WndMailBox		wndMailBox;    	HWND			TimerOwner[NUM_WIN_TIMERS];            	int				TimerID[NUM_WIN_TIMERS];                	WORD			TimerMask;						} 	MsgQueue;typedef MsgQueue* 	PMsgQueue;BOOL GUIAPIGetMessage(	PMSG pMsg,	HWND hWnd);BOOL GUIAPIPostMessage(	HWND hWnd,	int iMsg,	WPARAM wParam,	LPARAM lParam);BOOL GUIAPIPostQuitMessage(	HWND hWnd);int GUIAPISendMessage(	HWND hWnd,	int iMsg,	WPARAM wParam,	LPARAM lParam);BOOL GUIAPISendNotifyMessage(	HWND hWnd,	int iMsg,	WPARAM wParam,	LPARAM lParam);BOOL GUIAPITranslateMessage(	PMSG pMsg);int GUIAPIDispatchMessage(	PMSG pMsg);BOOL GUIAPINotifyParent(	HWND hWnd,	int iMsg);//==========================================================================//									REGCLASS						//==========================================================================typedef struct tagWNDCLASSEX {	UINT					cbSize;				//size of this structure	UINT					style;				//style of application window	WNDPROC					lpfnWndProc;		//callback function pointer	HINSTANCE				hInstance;			//	HICON					hIcon;				//	HICON					hIconSm;			//	HCURSOR					hCursor;			//	HBRUSH					hbrBackground;		//	char*					lpszMenuName;		//	char*					lpszClassName;		//	DWORD					cbClsExtra;			//reserved	DWORD					cbWndExtra;			//reserved	struct tagWNDCLASSEX*	pNext;} WNDCLASSEX;typedef	WNDCLASSEX* PWNDCLASSEX; BOOL GUIAPIRegisterClass(	WNDCLASSEX* lpwcx);//get register class by class namePWNDCLASSEX GUIAPIGetRegClass(	char* lpszClassName);//==========================================================================//									SYSTEM						//==========================================================================int GUIAPI GetSystemMetrics(	int nIndex);int GUIAPI GetSysCharWidth();int GUIAPI GetSysCCharWidth();int GUIAPI GetSysCharHeight();//==========================================================================//									TEXT						//==========================================================================BOOL GUIAPI DrawText(	HDC hDC,	char* lpString,	int nCount,	LPRECT lpRect,	UINT uFormat);BOOL GUIAPI DrawTextAngle(	HDC hDC,	char* lpString,	int nCount,POINT* 	lpPoint,double fDirection);//==========================================================================//									TIMER						//==========================================================================BOOL  GUIAPI SetTimer(	HWND hWnd,	int id,	int speed);BOOL GUIAPI KillTimer(	HWND hWnd,	int id);BOOL GUIAPI ResetTimer(	HWND hWnd,	int id, 	int speed);void GUIAPI StartTimer();void GUIAPI EndTimer();//==========================================================================//									WINBASE						//==========================================================================typedef struct tagPAINTSTRUCT {	BOOL bPaintDirect;    HDC  hdc;    BOOL fErase;    RECT rcPaint;    BOOL fRestore;    BOOL fIncUpdate;    BYTE rgbReserved[32];} PAINTSTRUCT;typedef PAINTSTRUCT* LPPAINTSTRUCT;#define BYCLIENT  0#define BYVSCROLL 1#define BYHSCROLL 2#define BYOKBUTTON	3#define BYCLOSEBOX	4BOOL GUIAPI InvalidateRect(	const HWND hWnd, 	const PRECT lpRect, 	BOOL bErase);HDC GUIAPI BeginPaint(	const HWND hWnd,	LPPAINTSTRUCT lpPaint);BOOL GUIAPI EndPaint(	const HWND hWnd,	LPPAINTSTRUCT lpPaint);void GUIAPI ScreenToWindow(	const HWND hWnd,	int* px,	int* py);void GUIAPI ScreenToWindowRect(	const HWND hWnd,	LPRECT lprc);void GUIAPI WindowToScreen(	const HWND hWnd,	int* px, 	int* py);void GUIAPI WindowToScreenRect(	const HWND hWnd,	LPRECT lprc);void GUIAPI WindowToClient(	const HWND hWnd,	int* px,	int* py);void GUIAPI WindowToClientRect(	const HWND hWnd,	LPRECT lprc);void GUIAPI ClientToWindow(	const HWND hWnd, 	int* px, 	int* py);void GUIAPI ClientToWindowRect(	const HWND hWnd,	LPRECT lprc);void GUIAPI ScreenToClient(	const HWND hWnd,	int* px,	int* py);void GUIAPI ScreenToClientRect(	const HWND hWnd,	LPRECT lprc);void GUIAPI ClientToScreen(	const HWND hWnd,	int* px,	int* py);void GUIAPI ClientToScreenRect(	const HWND hWnd,	LPRECT lprc);BOOL GUIAPI GetWindowRect(	HWND hWnd,	LPRECT lpRect);BOOL GUIAPI GetClientRect(	const HWND hWnd, 	LPRECT lpRect);void GUIAPI SetFocus(	const HWND hWnd);//==========================================================================//									WINDOW					//==========================================================================#define WS_TYPEMASK			0x000f0000L#define WS_DESKTOP				0x00010000L#define WS_MAIN					0x00020000L#define WS_CHILD           			0x00030000L#define WS_CONTROL          		0x00040000L#define WS_MENUWIN          		0x00050000L#define WS_IMEWIN           		0x00060000L#define WS_SKBWIN           		0x00070000L//window style#define WS_STYLEMASK        		0x0000ff00L#define WS_BORDER				0x00000100L#define WS_CAPTION				0x00000200L#define WS_CLOSEBOX			0x00000400L#define WS_OVERLAPPEDWINDOW	0x00000700L#define WS_VSCROLL				0x00000800L#define WS_HSCROLL				0x00001000L#define WS_THINBORDER			0x00002000L#define WS_THICKBORDER			0x00004000L#define WS_OKBUTTON			0x00008000L//window status#define WS_STATUSMASK			0x000000ffL#define WS_VISIBLE          			0x00000001L#define WS_FOCUS	        		0x00000002L#define WS_DISABLE				0x00000004L#define WS_ACTIVE	        		0x00000008L#define WS_TRANS				0x00000010L#define WS_OKBUTTONPRESSED	0x00000020L#define WS_CLOSEBOXPRESSED	0x00000040LHWND GUIAPI CreateWindow(  char* lpClassName,	// pointer to registered class name  char* lpWindowName,	// pointer to window name  DWORD dwStyle,        // window style & window statue  int x,                // horizontal position of window  int y,                // vertical position of window  int nWidth,           // window width  int nHeight,          // window height  HWND hWndParent,      // handle to parent or owner window  HMENU hMenu,          // handle to menu or child-window identifier  HANDLE hInstance,    	// handle to application instance  LPVOID lpParam        // pointer to window-creation data);void GUIAPI DestroyWindow(	HWND hWnd);BOOL GUIAPI ShowWindow(	HWND hWnd, 	int nCmdShow);BOOL GUIAPI UpdateWindow(	const HWND hWnd);BOOL GUIAPI MoveWindow(	HWND hWnd, 	int x, 	int y);BOOL GUIAPI ResizeWindow(	HWND hWnd,	LPRECT lpRect);//==========================================================================//									WINNC					//==========================================================================//scrollbarstatus#define SS_DISABLED		0x00000001typedef struct tagSCROLLINFO {// si	DWORD dwStatus;//  Enalble/Disable	UINT cbSize;	UINT fMask;	int  nMin;	int  nMax;	UINT nPage;	int  nPos;	int  nTrackPos;}   SCROLLINFO;typedef SCROLLINFO *LPSCROLLINFO;typedef struct tagSCROLLCURSTATE {	int iSliderBarVal;//left or top value	int iSliderBarLen;//length(heigh or width)	int iClickPos;}	SCROLLCURSTATE;typedef SCROLLCURSTATE* LPSCROLLCURSTATE;int  GUIAPI SetScrollInfo(	HWND hwnd, 	int fnBar, 	LPSCROLLINFO lpsi,	BOOL fRedraw);int  GUIAPI SetScrollPos(	HWND hWnd,	int nBar,	int nPos,	BOOL bRedraw);BOOL GUIAPI SetScrollRange(	HWND hWnd,	int nBar,	int nMinPos,	int nMaxPos,	BOOL bRedraw);int  GUIAPI GetScrollInfo (	HWND hWnd, 	LPSCROLLINFO lpsi);BOOL GUIAPI EnableScrollBar(	HWND hWnd, 	int iSBar, 	BOOL bEnable);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -