📄 guiwindow.h
字号:
/* $id:guiWindow.h V1.0 2001/10/10 */
/******************************************************************************
* This source code has been made available to you by SEIKO EPSON on
* AS-IS.Anyone receiving this source is licensed under
* SEIKO EPSON copyrights to use it in any way he or she deems fit,including
* copying it,modifying it,compiling it,and redistributing it either with
* or without modifictions.
*
*
* Any person who transfers this source code or any derivative work must
* include the SEIKO EPSON copyright notice, this paragraph,and the preceding
* two paragraphs in the transferred software.
*
*
* COPYRIGHT SEIKO EPSON CORPORATION 2001
* LICENSED MATERIAL - PROGRAM PROPERTY OF EPSON
*****************************************************************************/
/******************************************************************************
*
* FILE: guiWindow.h
*
* MODULE: System predefined data types
*
* PURPOSE: Define some system level data types and some key macros
*
* AUTHOR(S):Chen Hong
*
* GROUP:GUI_GROUP
*
* DATE CREATED:2001/10/16
*
* REFERENCE DOCUMENT ID:
*
* MODIFICATIONS:
* Date user Name Description
* 2001/10/16 Chen Hong Create this file
*********************************************************************************/
#ifndef _GUIWINDOW_H
#define _GUIWINDOW_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef T_WORD (* T_GUI_WndProc)(T_GUI_HWND, T_WORD, T_GUI_WPARAM, T_GUI_LPARAM);
typedef T_WORD (* T_GUI_KeyMsgHook)(T_GUI_HWND, T_WORD, T_GUI_WPARAM, T_GUI_LPARAM);
typedef T_WORD (* T_GUI_MouseMsgHook)(T_GUI_HWND, T_WORD, T_GUI_WPARAM, T_GUI_LPARAM);
/******************************** Message support ****************************/
/* definitions of common messages. */
#define MSG_SYNCMSG 0x0000
#define MSG_NULLMSG 0x0000
/* Group 1 from 0x0001 to 0x000F, the mouse messages. */
#define MSG_FIRSTMOUSEMSG 0x0001
#define MSG_LBUTTONDOWN 0x0001
#define MSG_LBUTTONUP 0x0002
#define MSG_LBUTTONDBLCLK 0x0003
#define MSG_MOUSEMOVE 0x0004
#define MSG_RBUTTONDOWN 0x0005
#define MSG_RBUTTONUP 0x0006
#define MSG_RBUTTONDBLCLK 0x0007
#define MSG_NCMOUSEOFF 0x0007
#define MSG_NCLBUTTONDOWN 0x0008
#define MSG_NCLBUTTONUP 0x0009
#define MSG_NCLBUTTONDBLCLK 0x000A
#define MSG_NCMOUSEMOVE 0x000B
#define MSG_NCRBUTTONDOWN 0x000C
#define MSG_NCRBUTTONUP 0x000D
#define MSG_NCRBUTTONDBLCLK 0x000E
#define MSG_LASTMOUSEMSG 0x000F
/* Group 2 from 0x0010 to 0x001F, the key messages.*/
#define MSG_FIRSTKEYMSG 0x0010
#define MSG_KEYDOWN 0x0010
#define MSG_CHAR 0x0011
#define MSG_KEYUP 0x0012
#define MSG_SYSKEYDOWN 0x0013
#define MSG_SYSCHAR 0x0014
#define MSG_SYSKEYUP 0x0015
#define MSG_LASTKEYMSG 0x001F
/* Group 3 from 0x0020 to 0x005F, the post-mousekey messages. */
#define MSG_FIRSTPOSTMSG 0x0020
#define MSG_SETCURSOR 0x0020
#define HT_UNKNOWN 0x00
#define HT_OUT 0x01
#define HT_MENUBAR 0x02
#define HT_TRANSPARENT 0x03
#define HT_BORDER_TOP 0x04
#define HT_BORDER_BOTTOM 0x05
#define HT_BORDER_LEFT 0x06
#define HT_BORDER_RIGHT 0x07
#define HT_CORNER_TL 0x08
#define HT_CORNER_TR 0x09
#define HT_CORNER_BL 0x0A
#define HT_CORNER_BR 0x0B
#define HT_CLIENT 0x0C
#define SBPOS_LEFTARROW 0x81
#define SBPOS_RIGHTARROW 0x82
#define SBPOS_LEFTSPACE 0x83
#define SBPOS_RIGHTSPACE 0x84
#define SBPOS_UPARROW 0x85
#define SBPOS_DOWNARROW 0x86
#define SBPOS_UPSPACE 0x87
#define SBPOS_DOWNSPACE 0x88
#define SBPOS_THUMB 0x89
#define SBPOS_UNKNOWN 0x80
#define SBPOS_MASK 0x80
#define HT_BORDER 0x11
#define HT_NCLIENT 0x12
#define HT_CAPTION 0x13
#define HT_ICON 0x14
#define HT_CLOSEBUTTON 0x15
#define HT_MAXBUTTON 0x16
#define HT_MINBUTTON 0x17
#define HT_HSCROLL 0x18
#define HT_VSCROLL 0x19
#define HT_NEEDCAPTURE 0x10
#define MSG_NCHITTEST 0x0021
#define MSG_HITTEST MSG_NCHITTEST
#define MSG_CHANGESIZE 0x0022
#define MSG_QUERYNCRECT 0x0023
#define MSG_QUERYCLIENTAREA 0x0024
#define MSG_SIZECHANGING 0x0025
#define MSG_SIZECHANGED 0x0026
#define MSG_SETFOCUS 0x0030
#define MSG_KILLFOCUS 0x0031
#define MSG_MOUSEACTIVE 0x0032
#define MSG_ACTIVE 0x0033
#define MSG_CHILDHIDDEN 0x0034
#define RCTM_CLICK 1
#define RCTM_KEY 2
#define RCTM_MESSAGE 3
#define RCTM_SHOWCTRL 4
#define MSG_ACTIVEMENU 0x0040
#define MSG_DEACTIVEMENU 0x0041
/* Scroll bar notifying code */
#define SB_LINEUP 0x01
#define SB_LINEDOWN 0x02
#define SB_LINELEFT 0x03
#define SB_LINERIGHT 0x04
#define SB_PAGEUP 0x05
#define SB_PAGEDOWN 0x06
#define SB_PAGELEFT 0x07
#define SB_PAGERIGHT 0x08
#define SB_THUMBPOSITION 0x09
#define SB_THUMBTRACK 0x0A
#define SB_ENDSCROLL 0x0B
#define MSG_HSCROLL 0x0042
#define MSG_VSCROLL 0x0043
#define MSG_NCSETCURSOR 0x0044
#define MSG_MOUSEMOVEIN 0x0050
#define MSG_LASTPOSTMSG 0x005F
/* Group 4 from 0x0060 to 0x009F, the creation messages. */
#define MSG_FIRSTCREATEMSG 0x0060
#define MSG_CREATE 0x0060
#define MSG_NCCREATE 0x0061
#define MSG_INITPANES 0x0062 /* not used but for future */
#define MSG_DESTROYPANES 0x0063 /* not used but for future */
#define MSG_DESTROY 0x0064
#define MSG_NCDESTROY 0x0065
#define MSG_CLOSE 0x0066
#define MSG_NCCALCSIZE 0x0067
#define MSG_MAXIMIZE 0x0068
#define MSG_MINIMIZE 0x0069
#define MSG_LASTCREATEMSG 0x009F
/* Group 5 from 0x00A0 to 0x00CF, the paint messages. */
#define MSG_FIRSTPAINTMSG 0x00A0
#define MSG_SHOWWINDOW 0x00A0
#define MSG_ERASEBKGND 0x00B0
#define MSG_PAINT 0x00B1
#define MSG_NCPAINT 0x00B2
#define MSG_NCACTIVATE 0x00B3
#define MSG_SYNCPAINT 0x00B4
#define MSG_LASTPAINTMSG 0x00CF
/* Group 6 from 0x00D0 to 0x00EF, the desktop messages. */
#define MSG_FIRSTSESSIONMSG 0x00D0
#define MSG_STARTSESSION 0x00D0
#define MSG_QUERYENDSESSION 0x00D1
#define MSG_ENDSESSION 0x00D2
#define MSG_REINITSESSION 0x00D3
#define MSG_ERASEDESKTOP 0x00E0
#define MSG_PAINTDESKTOP 0x00E1
#define MSG_DT_MOUSEOFF 0x00E1
#define MSG_DT_LBUTTONDOWN 0x00E2
#define MSG_DT_LBUTTONUP 0x00E3
#define MSG_DT_LBUTTONDBLCLK 0x00E4
#define MSG_DT_MOUSEMOVE 0x00E5
#define MSG_DT_RBUTTONDOWN 0x00E6
#define MSG_DT_RBUTTONUP 0x00E7
#define MSG_DT_RBUTTONDBLCLK 0x00E8
#define MSG_DT_KEYOFF 0x00DA
#define MSG_DT_KEYDOWN 0x00EA
#define MSG_DT_CHAR 0x00EB
#define MSG_DT_KEYUP 0x00EC
#define MSG_DT_SYSKEYDOWN 0x00ED
#define MSG_DT_SYSCHAR 0x00EE
#define MSG_DT_SYSKEYUP 0x00EF
#define MSG_LASTSESSIONMSG 0x00EF
/* Group 7 from 0x00F0 to 0x010F, the window messages. */
#define MSG_FIRSTWINDOWMSG 0x00F0
#define MSG_ADDNEWMAINWIN 0x00F0
#define MSG_REMOVEMAINWIN 0x00F1
#define MSG_MOVETOTOPMOST 0x00F2
#define MSG_SETACTIVEMAIN 0x00F3
#define MSG_GETACTIVEMAIN 0x00F4
#define MSG_SHOWMAINWIN 0x00F5
#define MSG_HIDEMAINWIN 0x00F6
#define MSG_MOVEMAINWIN 0x00F7
#define MSG_SETCAPTURE 0x00F8
#define MSG_GETCAPTURE 0x00F9
#define MSG_ENDTRACKMENU 0x00FA
#define MSG_TRACKPOPUPMENU 0x00FB
#define MSG_CLOSEMENU 0x00FC
#define MSG_SCROLLMAINWIN 0x00FD
#define MSG_CARET_CREATE 0x00FE
#define MSG_CARET_DESTROY 0x00FF
#define MSG_ENABLEMAINWIN 0x0100
#define MSG_ISENABLED 0x0101
#define MSG_SETWINCURSOR 0x0102
#define MSG_SHOWGLOBALCTRL 0x010A
#define MSG_HIDEGLOBALCTRL 0x010B
#define MSG_LASTWINDOWMSG 0x010F
/* Group 8 from 0x0120 to 0x013F, the dialog and control messages. */
#define MSG_FIRSTCONTROLMSG 0x0120
#define MSG_COMMAND 0x0120
#define MSG_SYSCOMMAND 0x0121
#define MSG_GETDLGCODE 0x0122
#define MSG_INITDIALOG 0x0123
#define MSG_NEXTDLGCTRL 0x0124
#define MSG_ENTERIDLE 0x0125
#define MSG_DLG_GETDEFID 0x0126
#define MSG_DLG_SETDEFID 0x0127
#define MSG_DLG_REPOSITION 0x0128
#define MSG_GETFONT 0x0130
#define MSG_SETFONT 0x0131
#define MSG_GETTEXTLENGTH 0x0132
#define MSG_GETTEXT 0x0133
#define MSG_SETTEXT 0x0134
#define MSG_ENABLE 0x0135
#define MSG_EDIT_LOSTFOCUS 0x0136
#define MSG_EDIT_GOTFOCUS 0x0137
#define MSG_LASTCONTROLMSG 0x013F
/* Group 9 from 0x0140 to 0x016F, the system messages. */
#define MSG_FIRSTSYSTEMMSG 0x0140
#define MSG_QUIT 0x0140
#define MSG_IDLE 0x0142
#define MSG_TIMEOUT 0x0143
#define MSG_TIMER 0x0144
#define MSG_CARETBLINK 0x0145
#define MSG_IME_REGISTER 0x0151
#define MSG_IME_UNREGISTER 0x0152
#define MSG_IME_OPEN 0x0153
#define MSG_IME_CLOSE 0x0154
#define MSG_IME_SETSTATUS 0x0156
#define MSG_IME_GETSTATUS 0x0157
#define IS_ENABLE 1
#define IS_FULLCHAR 2
#define IS_FULLPUNC 3
#define IS_METHOD 4
#define MSG_IME_SETTARGET 0x0158
#define MSG_IME_GETTARGET 0x0159
#define MSG_SHOWMENU 0x0160
#define MSG_HIDEMENU 0x0161
#define MSG_ADDTIMER 0x0162
#define MSG_REMOVETIMER 0x0163
#define MSG_RESETTIMER 0x0164
#define MSG_WINDOWCHANGED 0x0165
#define MSG_BROADCASTMSG 0x0166
#define MSG_REGISTERWNDCLASS 0x0167
#define MSG_UNREGISTERWNDCLASS 0x0168
#define MSG_NEWCTRLINSTANCE 0x0169
#define MSG_REMOVECTRLINSTANCE 0x016A
#define MSG_GETCTRLCLASSINFO 0x016B
#define MSG_CTRLCLASSDATAOP 0x016C
#define CCDOP_GETCCI 0x01
#define CCDOP_SETCCI 0x02
#define MSG_REGISTERKEYHOOK 0x016D
#define MSG_REGISTERMOUSEHOOK 0x016E
#define MSG_UNREGISTERHOOK 0x016F
#define MSG_LASTSYSTEMMSG 0x016F
/* Group 10 from 0x0170 to 0x018F, the menu messages */
#define MSG_FIRSTMENUMSG 0x0170
#define MSG_INITMENU 0x0170
#define MSG_INITMENUPOPUP 0x0171
#define MSG_MENUSELECT 0x0172
#define MSG_MENUCHAR 0x0173
#define MSG_ENTERMENULOOP 0x0174
#define MSG_EXITMENULOOP 0x0175
#define MSG_CONTEXTMENU 0x0176
#define MSG_NEXTMENU 0x0177
#define MSG_LASTMENUMSG 0x018F
#define MSG_FIRSTUSERMSG 0x0800
#define MSG_USER 0x0800
#define MSG_LASTUSERMSG 0xEFFF
typedef struct T_GUI_Msg
{
T_GUI_HWND hWnd;
T_WORD message;
T_GUI_WPARAM wParam;
T_GUI_LPARAM lParam;
T_UWORD time;
T_GUI_Point pt;
}T_GUI_Msg;
typedef T_GUI_Msg* T_GUI_pMsg;
#define QS_NOTIFYMSG 0x10000000
#define QS_DESKTIMER 0x20000000
#define QS_POSTMSG 0x40000000
#define QS_QUIT 0x80000000
#define QS_INPUT 0x01000000
#define QS_PAINT 0x02000000
#define QS_TIMER 0x0000FFFF
#define QS_EMPTY 0x00000000
T_WORD fnGUI_GetMessage (T_GUI_pMsg pMsg, T_GUI_HWND hMainWnd);
T_BOOL fnGUI_HavePendingMessage (T_GUI_HWND hMainWnd);
#define PM_NOREMOVE 0x0000
#define PM_REMOVE 0x0001
#define PM_NOYIELD 0x0002
T_BOOL fnGUI_PeekPostMessage (T_GUI_pMsg pMsg, T_GUI_HWND hWnd, T_WORD iMsgFilterMin,
T_WORD iMsgFilterMax, T_GUI_UINT uRemoveMsg);
T_WORD fnGUI_PostMessage (T_GUI_HWND hWnd, T_WORD iMsg, T_GUI_WPARAM wParam, T_GUI_LPARAM lParam);
T_WORD fnGUI_SendMessage (T_GUI_HWND hWnd, T_WORD iMsg, T_GUI_WPARAM wParam, T_GUI_LPARAM lParam);
T_WORD fnGUI_SendNotifyMessage (T_GUI_HWND hWnd, T_WORD iMsg, T_GUI_WPARAM wParam, T_GUI_LPARAM lParam);
T_WORD fnGUI_BroadcastMessage (T_WORD iMsg, T_GUI_WPARAM wParam, T_GUI_LPARAM lParam);
T_WORD fnGUI_PostQuitMessage (T_GUI_HWND hWnd);
T_WORD fnGUI_TranslateMessage (T_GUI_pMsg pMsg);
T_WORD fnGUI_DispatchMessage (T_GUI_pMsg pMsg);
T_WORD fnGUI_ThrowAwayMessages (T_GUI_HWND pMainWnd);
T_BOOL fnGUI_EmptyMessages (T_GUI_HWND hWnd);
/******************************* Hooks support *******************************/
#define HOOK_OK 0
#define HHOOK_INVALID -1
#define HOOK_STOP 1
#define HOOK_GOON 2
typedef struct T_GUI_KeyHook
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -