?? window.h
字號:
#define HOOK_OK 0#define HHOOK_INVALID -1#define HOOK_STOP 1#define HOOK_GOON 2typedef struct _KEYHOOK{ HWND hWnd; KEYMSGHOOK hook;}KEYHOOK;typedef struct _MOUSEHOOK{ HWND hWnd; MOUSEMSGHOOK hook;}MOUSEHOOK;HHOOK GUIAPI RegisterKeyMsgHook (HWND hWnd, KEYMSGHOOK hook);HHOOK GUIAPI RegisterMouseMsgHook (HWND hWnd, MOUSEMSGHOOK hook);int GUIAPI UnregisterHook (HHOOK hHook);/******************************* Style definitions ***************************//* Class styles */#define CS_VREDRAW 0x0001#define CS_HREDRAW 0x0002#define CS_OWNDC 0x0020#define CS_CLASSDC 0x0040#define CS_PARENTDC 0x0080#define CS_SAVEBITS 0x0800#define CS_DBLCLKS 0x0008#define CS_BYTEALIGNCLIENT 0x1000#define CS_BYTEALIGNWINDOW 0x2000#define CS_NOCLOSE 0x0200#define CS_KEYCVTWINDOW 0x0004#define CS_NOKEYCVT 0x0100#define CS_GLOBALCLASS 0x4000/* Window Styles *//* Basic window types */#define WS_OVERLAPPED 0x00000000L#define WS_POPUP 0x80000000L#define WS_CHILD 0x40000000L/* Clipping styles */ // not supported/* Generic window states */#define WS_VISIBLE 0x08000000L#define WS_DISABLED 0x04000000L/* Main window states */#define WS_MINIMIZE 0x02000000L#define WS_MAXIMIZE 0x01000000L/* Main window styles */#define WS_CAPTION 0x20000000L#define WS_SYSMENU 0x10000000L#define WS_DLGFRAME 0x00800000L#define WS_BORDER 0x00400000L#define WS_THICKFRAME 0x00200000L#define WS_THINFRAME 0x00100000L#define WS_VSCROLL 0x00080000L#define WS_HSCROLL 0x00040000L#define WS_MINIMIZEBOX 0x00020000L#define WS_MAXIMIZEBOX 0x00010000L/* Control window styles */#define WS_GROUP 0x00020000L#define WS_TABSTOP 0x00010000L/* Common Window Styles */#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | \ WS_CAPTION | \ WS_SYSMENU | \ WS_THICKFRAME | \ WS_MINIMIZEBOX | \ WS_MAXIMIZEBOX ) #define WS_POPUPWINDOW (WS_POPUP | \ WS_BORDER | \ WS_SYSMENU)#define WS_CHILDWINDOW (WS_CHILD)/* Extended Window Styles */#define WS_EX_NONE 0x00000000L // supported#define WS_EX_DLGMODALFRAME 0x00000001L#define WS_EX_USEPRIVATECDC 0x00000002L // supported#define WS_EX_NOPARENTNOTIFY 0x00000004L#define WS_EX_TOPMOST 0x00000008L // supported#define WS_EX_ACCEPTFILES 0x00000010L#define WS_EX_TRANSPARENT 0x00000020L#define WS_EX_MDICHILD 0x00000040L#define WS_EX_TOOLWINDOW 0x00000080L#define WS_EX_WINDOWEDGE 0x00000100L#define WS_EX_CLIENTEDGE 0x00000200L#define WS_EX_CONTEXTHELP 0x00000400L#define WS_EX_USEPARENTCURSOR 0x00000800L // supported#define WS_EX_RIGHT 0x00001000L#define WS_EX_LEFT 0x00000000L#define WS_EX_RTLREADING 0x00002000L#define WS_EX_LTRREADING 0x00000000L#define WS_EX_LEFTSCROLLBAR 0x00004000L#define WS_EX_RIGHTSCROLLBAR 0x00000000L#define WS_EX_CONTROLPARENT 0x00010000L#define WS_EX_STATICEDGE 0x00020000L#define WS_EX_APPWINDOW 0x00040000L#define WS_EX_IMECOMPOSE 0x10000000L // supported#define WS_EX_NOCLOSEBOX 0x20000000L // supported#define WS_EX_CTRLASMAINWIN 0x40000000L // supported#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | \ WS_EX_CLIENTEDGE)#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | \ WS_EX_TOOLWINDOW | \ WS_EX_TOPMOST)/******************************** Main window support ************************/#define HWND_DESKTOP 0#define HWND_INVALID 0xFFFFFFFFtypedef struct _MAINWINCREATE{ DWORD dwStyle; DWORD dwExStyle; // the extended styles of main window. const char* spCaption; HMENU hMenu; HCURSOR hCursor; HICON hIcon; HWND hHosting; // the hosting main window. int (*MainWindowProc)(HWND, int, WPARAM, LPARAM); int lx, ty; int rx, by; int iBkColor; DWORD dwAddData;}MAINWINCREATE;typedef MAINWINCREATE* PMAINWINCREATE;BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle);BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle);HWND GUIAPI CreateMainWindow (PMAINWINCREATE pCreateStruct);BOOL GUIAPI DestroyMainWindow (HWND hWnd);int DefaultMainWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);int DefaultControlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);#ifdef _DEBUGvoid GUIAPI DumpWindow (FILE* fp, HWND hWnd);#endif /* _DEBUG */#define SW_HIDE 0x0000#define SW_SHOW 0x0010#define SW_SHOWNORMAL 0x0100void GUIAPI UpdateWindow (HWND hWnd, BOOL bErase);BOOL GUIAPI ShowWindow (HWND hWnd, int iCmdShow);BOOL GUIAPI EnableWindow (HWND hWnd, int fEnable);BOOL GUIAPI IsWindowEnabled (HWND hWnd);BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc);int GUIAPI GetWindowBkColor (HWND hWnd);HCURSOR GUIAPI GetWindowCursor (HWND hWnd);HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor);DWORD GUIAPI GetWindowStyle (HWND hWnd);DWORD GUIAPI GetWindowExStyle (HWND hWnd);DWORD GUIAPI GetWindowAdditionalData (HWND hWnd);DWORD GUIAPI SetWindowAdditionalData (HWND hWnd, DWORD newData);DWORD GUIAPI GetWindowAdditionalData2 (HWND hWnd);DWORD GUIAPI SetWindowAdditionalData2 (HWND hWnd, DWORD newData);DWORD GUIAPI GetWindowClassAdditionalData (HWND hWnd);DWORD GUIAPI SetWindowClassAdditionalData (HWND hWnd, DWORD newData);const char* GUIAPI GetWindowCaption (HWND hWnd);BOOL GUIAPI SetWindowCaption (HWND hWnd, const char* spCaption);WNDPROC GUIAPI GetWindowCallbackProc (HWND hWnd);WNDPROC GUIAPI SetWindowCallbackProc (HWND hWnd, WNDPROC newProc);BOOL GUIAPI InvalidateRect(HWND hWnd, const RECT* prc, BOOL bEraseBkgnd);HDC GUIAPI BeginPaint(HWND hWnd);void GUIAPI EndPaint(HWND hWnd, HDC hdc);int GUIAPI ClientWidthToWindowWidth (DWORD dwStyle, int cw);int GUIAPI ClientHeightToWindowHeight (DWORD dwStyle, int ch, BOOL hasMenu);void GUIAPI ClientToScreen(HWND hWnd, int* x, int* y);void GUIAPI ScreenToClient(HWND hWnd, int* x, int* y);void GUIAPI WindowToScreen(HWND hWnd, int* x, int* y);void GUIAPI ScreenToWindow(HWND hWnd, int* x, int* y);BOOL GUIAPI IsMainWindow (HWND hWnd);BOOL GUIAPI IsControl (HWND hWnd);BOOL GUIAPI IsWindow (HWND hWnd);HWND GUIAPI GetParent (HWND hWnd);BOOL GUIAPI IsWindowVisible (HWND hWnd);BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);HWND GUIAPI GetHosting (HWND hWnd);HWND GUIAPI GetFirstHosted (HWND hWnd);HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);int GUIAPI GetWindowTextLength (HWND hWnd);int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);HWND GUIAPI SetFocus(HWND hWnd);HWND GUIAPI GetFocus(void);HWND GUIAPI GetFocusChild (HWND hMainWnd);HWND GUIAPI SetActiveWindow(HWND hMainWnd);HWND GUIAPI GetActiveWindow(void);HWND GUIAPI SetCapture(HWND hMainWnd);HWND GUIAPI GetCapture(void);void GUIAPI ReleaseCapture(void);#define GetForegroundWindow GetActiveWindow#define SetForegroundWindow SetActiveWindowBOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h, BOOL fPaint);void GUIAPI ScrollWindow (HWND hWnd, int iOffx, int iOffy, const RECT* rc1, const RECT* rc2);#define SB_HORZ 1#define SB_VERT 2BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos);BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos);BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);#define SIF_RANGE 0x0001#define SIF_PAGE 0x0002#define SIF_POS 0x0004#define SIF_DISABLENOSCROLL 0x0008#define SIF_TRACKPOS 0x0010#define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)typedef struct tagSCROLLINFO{ UINT cbSize; UINT fMask; int nMin; int nMax; UINT nPage; int nPos; int nTrackPos;}SCROLLINFO, *LPSCROLLINFO;typedef SCROLLINFO const *LPCSCROLLINFO;BOOL GUIAPI SetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL);BOOL GUIAPI GetScrollInfo(HWND, int, LPSCROLLINFO);HWND GUIAPI GetMainWindowHandle(HWND hWnd);int GUIAPI CreateThreadForMainWindow(pthread_t* thread, pthread_attr_t* attr, void * (*start_routine)(void *), void * arg);pthread_t GUIAPI GetMainWinThread(HWND hMainWnd);void GUIAPI MainWindowThreadCleanup(HWND hMainWnd);int GUIAPI WaitMainWindowClose(HWND hWnd, void** returnval);#define MWM_MINWIDTH 0#define MWM_MINHEIGHT 1#define MWM_BORDER 2#define MWM_THICKFRAME 3#define MWM_CAPTIONY 4#define MWM_ICONX 5#define MWM_ICONY 6#define MWM_CAPTIONOFFY 7#define MWM_MENUBARY 8#define MWM_MENUBAROFFX 9#define MWM_MENUBAROFFY 10#define MWM_MENUITEMY 11 #define MWM_INTERMENUITEMX 12#define MWM_INTERMENUITEMY 13#define MWM_MENUITEMOFFX 14#define MWM_MENUTOPMARGIN 15#define MWM_MENUBOTTOMMARGIN 16#define MWM_MENULEFTMARGIN 17#define MWM_MENURIGHTMARGIN 18#define MWM_MENUITEMMINX 19#define MWM_MENUSEPARATORY 20#define MWM_MENUSEPARATORX 21#define MWM_SB_HEIGHT 22#define MWM_SB_WIDTH 23#define MWM_SB_INTERX 24#define MWM_THINFRAME 25#define MWM_CXVSCROLL 26#define MWM_CYVSCROLL 27#define MWM_CXHSCROLL 28#define MWM_CYHSCROLL 29#define MWM_MINBARLEN 30#define MWM_DEFBARLEN 31#define MWM_ITEM_NUMBER 32extern int WinMainMetrics[];#define GetMainWinMetrics(iItem) (WinMainMetrics[iItem])#define SYSBMP_MINIMIZE 0#define SYSBMP_MAXIMIZE 1#define SYSBMP_RESTORE 2#define SYSBMP_CLOSE 3#define SYSBMP_ARROWUP 4#define SYSBMP_ARROWUPD 5#define SYSBMP_ARROWDOWN 6#define SYSBMP_ARROWDOWND 7#define SYSBMP_ARROWLEFT 8#define SYSBMP_ARROWLEFTD 9#define SYSBMP_ARROWRIGHT 10#define SYSBMP_ARROWRIGHTD 11#define SYSBMP_ITEM_NUMBER 12extern BITMAP SystemBitmap[];#define GetSystemBitmap(iItem) (SystemBitmap + iItem)#define IDI_APPLICATION 0#define IDI_HAND 1#define IDI_STOP IDI_HAND#define IDI_QUESTION 2#define IDI_EXCLAMATION 3#define IDI_ASTERISK 4#define IDI_INFORMATION IDI_ASTERISK#define SYSICO_ITEM_NUMBER 5extern HICON LargeSystemIcon[];#define GetLargeSystemIcon(iItem) (LargeSystemIcon[iItem])extern HICON SmallSystemIcon[];#define GetSmallSystemIcon(iItem) (SmallSystemIcon[iItem])BOOL GUIAPI LoadSystemBitmap (PBITMAP pBitmap, const char* szItemName);HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);/********************** Non-Main Window Class Support ************************/#define CS_VREDRAW 0x0001#define CS_HREDRAW 0x0002#define CS_DBLCLKS 0x0008#define CS_OWNDC 0x0020#define CS_CLASSDC 0x0040#define CS_PARENTDC 0x0080#define CS_NOCLOSE 0x0200#define CS_SAVEBITS 0x0800#define CS_BYTEALIGNCLIENT 0x1000#define CS_BYTEALIGNWINDOW 0x2000#define CS_GLOBALCLASS 0x4000#define CS_IME 0x00010000#define COP_STYLE 0x0001#define COP_HCURSOR 0x0002#define COP_BKCOLOR 0x0004#define COP_WINPROC 0x0008#define COP_ADDDATA 0x0010typedef struct _WNDCLASS{ char* spClassName; DWORD opMask; DWORD dwStyle; HCURSOR hCursor;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -