?? window.h
字號:
/* window.h * * This file include definitions of Window Management module. * * MiniGUI for Linux Version 0.3.xx * Copyright (c) 1999, 2000 Wei Yongming. * Last modified date: 2000/06/18 *//*** This library is free software; you can redistribute it and/or** modify it under the terms of the GNU Library General Public** License as published by the Free Software Foundation; either** version 2 of the License, or (at your option) any later version.**** This library is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU** Library General Public License for more details.**** You should have received a copy of the GNU Library General Public** License along with this library; if not, write to the Free** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,** MA 02111-1307, USA*/#ifndef GUI_WINDOW_H #define GUI_WINDOW_H#include <pthread.h>#include <semaphore.h>#ifdef __cplusplusextern "C" {#endif /* __cplusplus */typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM);typedef int (* KEYMSGHOOK)(HWND, int, WPARAM, LPARAM);typedef int (* MOUSEMSGHOOK)(HWND, int, WPARAM, 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 // this is an async message.#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_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#define MSG_DESTROYPANES 0x0063#define MSG_DESTROY 0x0064#define MSG_NCDESTROY 0x0065#define MSG_CLOSE 0x0066#define MSG_NCCALCSIZE 0x0067#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 // this is an async message.#define MSG_PAINT 0x00B1#define MSG_NCPAINT 0x00B2#define MSG_NCACTIVATE 0x00B3#define MSG_SYNCPAINT 0x00B4#define MSG_ENABLE 0x00C0#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_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 0xEFFFtypedef struct _MSG{ HWND hwnd; int message; WPARAM wParam; LPARAM lParam; struct timeval time; POINT pt; void* pAdd;}MSG;typedef MSG* PMSG;#define QS_NOTIFYMSG 0x00000100#define QS_SYNCMSG 0x00000200#define QS_POSTMSG 0x00000400#define QS_QUIT 0x00000800#define QS_INPUT 0x00001000#define QS_PAINT 0x00002000#define QS_TIMER 0x000000FF#define QS_EMPTY 0x00000000int GUIAPI GetMessage (PMSG pMsg, HWND hMainWnd);BOOL GUIAPI HavePendingMessage (HWND hMainWnd);#define PM_NOREMOVE 0x0000#define PM_REMOVE 0x0001#define PM_NOYIELD 0x0002BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin, int iMsgFilterMax, UINT uRemoveMsg); int GUIAPI PostMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);int GUIAPI SendMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);int GUIAPI PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);int GUIAPI SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);int GUIAPI SendNotifyMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);int GUIAPI BroadcastMessage (int iMsg, WPARAM wParam, LPARAM lParam);int GUIAPI PostQuitMessage (HWND hWnd);int GUIAPI TranslateMessage (PMSG pMsg);int GUIAPI DispatchMessage (PMSG pMsg);int GUIAPI ThrowAwayMessages (HWND pMainWnd);int GUIAPI TranslateAccelerator (HWND hWnd, HACCEL hAccel, PMSG pMsg);#ifdef _MSG_STRINGconst char* GUIAPI Message2Str (int message);void GUIAPI PrintMessage (FILE* fp, HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);#endif/******************************* Hooks support *******************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -