📄 osdwinuser.h
字号:
WINUSERAPI DWORD WINAPI CheckMenuItem(HMENU hMenu,UINT uIDCheckItem,
UINT uCheck);
WINUSERAPI BOOL WINAPI EnableMenuItem(HMENU hMenu,UINT uIDEnableItem,UINT uEnable);
WINUSERAPI HMENU WINAPI GetSubMenu(HMENU hMenu,int nPos);
HBRUSH WINAPI GetSysColorBrush(INT);
HPEN WINAPI GetSysColorPen(INT);
WINUSERAPI UINT WINAPI GetMenuItemID(HMENU hMenu,int nPos);
WINUSERAPI int WINAPI GetMenuItemCount(HMENU hMenu);
WINUSERAPI BOOL WINAPI InsertMenu(HMENU hMenu,UINT uPosition,UINT uFlags,
UINT uIDNewItem,LPCSTR lpNewItem);
WINUSERAPI BOOL WINAPI AppendMenu(HMENU hMenu,UINT uFlags,
UINT uIDNewItem,LPCSTR lpNewItem);
WINUSERAPI BOOL WINAPI ModifyMenu(HMENU hMnu,UINT uPosition,UINT uFlags,
UINT uIDNewItem,LPCSTR lpNewItem);
WINUSERAPI BOOL WINAPI RemoveMenu(HMENU hMenu,UINT uPosition,UINT uFlags);
WINUSERAPI BOOL WINAPI DeleteMenu(HMENU hMenu,UINT uPosition,UINT uFlags);
WINUSERAPI BOOL WINAPI SetMenuItemBitmaps(HMENU hMenu,UINT uPosition,UINT uFlags,
HBITMAP hBitmapUnchecked,HBITMAP hBitmapChecked);
WINUSERAPI LONG WINAPI GetMenuCheckMarkDimensions(VOID);
#define MNC_IGNORE 0
#define MNC_CLOSE 1
#define MNC_EXECUTE 2
#define MNC_SELECT 3
typedef struct tagTPMPARAMS
{
UINT cbSize; /* Size of structure */
RECT rcExclude; /* Screen coordinates of rectangle to exclude when positioning */
} TPMPARAMS, *LPTPMPARAMS;
WINUSERAPI BOOL WINAPI TrackPopupMenuEx(HMENU, UINT, int, int, HWND, LPTPMPARAMS);
WINUSERAPI BOOL WINAPI TrackPopupMenu(HMENU hMenu,UINT uFlags,int x,int y,
int nReserved,HWND hWnd,CONST RECT *prcRect);
#define MNS_NOCHECK 0x80000000
#define MNS_MODELESS 0x40000000
#define MNS_DRAGDROP 0x20000000
#define MNS_AUTODISMISS 0x10000000
#define MNS_NOTIFYBYPOS 0x08000000
#define MNS_CHECKORBMP 0x04000000
#define MIM_MAXHEIGHT 0x00000001
#define MIM_BACKGROUND 0x00000002
#define MIM_HELPID 0x00000004
#define MIM_MENUDATA 0x00000008
#define MIM_STYLE 0x00000010
#define MIM_APPLYTOSUBMENUS 0x80000000
typedef struct tagMENUINFO
{
DWORD cbSize;
DWORD fMask;
DWORD dwStyle;
UINT cyMax;
HBRUSH hbrBack;
DWORD dwContextHelpID;
DWORD dwMenuData;
} MENUINFO, *LPMENUINFO;
typedef MENUINFO CONST *LPCMENUINFO;
WINUSERAPI BOOL WINAPI GetMenuInfo(HMENU,LPMENUINFO);
WINUSERAPI BOOL WINAPI SetMenuInfo(HMENU,LPCMENUINFO);
WINUSERAPI BOOL WINAPI EndMenu(VOID);
#define MIIM_STATE 0x00000001
#define MIIM_ID 0x00000002
#define MIIM_SUBMENU 0x00000004
#define MIIM_CHECKMARKS 0x00000008
#define MIIM_TYPE 0x00000010
#define MIIM_DATA 0x00000020
#define MIIM_STRING 0x00000040
#define MIIM_BITMAP 0x00000080
#define MIIM_FTYPE 0x00000100
#define HBMMENU_CALLBACK ((HBITMAP)-1)
#define HBMMENU_SYSTEM ((HBITMAP) 1)
#define HBMMENU_MBAR_RESTORE ((HBITMAP) 2)
#define HBMMENU_MBAR_MINIMIZE ((HBITMAP) 3)
#define HBMMENU_MBAR_CLOSE ((HBITMAP) 5)
#define HBMMENU_MBAR_CLOSE_D ((HBITMAP) 6)
#define HBMMENU_MBAR_MINIMIZE_D ((HBITMAP) 7)
#define HBMMENU_POPUP_CLOSE ((HBITMAP) 8)
#define HBMMENU_POPUP_RESTORE ((HBITMAP) 9)
#define HBMMENU_POPUP_MAXIMIZE ((HBITMAP) 10)
#define HBMMENU_POPUP_MINIMIZE ((HBITMAP) 11)
typedef struct tagMENUITEMINFOA
{
UINT cbSize;
UINT fMask;
UINT fType; // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
UINT fState; // used if MIIM_STATE
UINT wID; // used if MIIM_ID
HMENU hSubMenu; // used if MIIM_SUBMENU
HBITMAP hbmpChecked; // used if MIIM_CHECKMARKS
HBITMAP hbmpUnchecked; // used if MIIM_CHECKMARKS
DWORD dwItemData; // used if MIIM_DATA
LPSTR dwTypeData; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
UINT cch; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
//#if (_WIN32_WINNT >= 0x0500)
HBITMAP hbmpItem; // used if MIIM_BITMAP
//#endif
}MENUITEMINFO,*LPMENUITEMINFO;
typedef MENUITEMINFO CONST *LPCMENUITEMINFO;
WINUSERAPI BOOL WINAPI InsertMenuItem(HMENU,UINT,BOOL,LPCMENUITEMINFO);
WINUSERAPI BOOL WINAPI GetMenuItemInfo(HMENU,UINT,BOOL,LPMENUITEMINFO);
WINUSERAPI BOOL WINAPI SetMenuItemInfo(HMENU,UINT,BOOL,LPCMENUITEMINFO);
#define GMDI_USEDISABLED 0x0001L
#define GMDI_GOINTOPOPUPS 0x0002L
WINUSERAPI UINT WINAPI GetMenuDefaultItem(HMENU hMenu, UINT fByPos, UINT gmdiFlags);
WINUSERAPI BOOL WINAPI SetMenuDefaultItem(HMENU hMenu, UINT uItem, UINT fByPos);
WINUSERAPI BOOL WINAPI GetMenuItemRect(HWND hWnd, HMENU hMenu, UINT uItem, LPRECT lprcItem);
WINUSERAPI int WINAPI MenuItemFromPoint(HWND hWnd, HMENU hMenu, POINT ptScreen);
/* Flags for TrackPopupMenu */
#define TPM_LEFTBUTTON 0x0000L
#define TPM_RIGHTBUTTON 0x0002L
#define TPM_LEFTALIGN 0x0000L
#define TPM_CENTERALIGN 0x0004L
#define TPM_RIGHTALIGN 0x0008L
//#if(WINVER >= 0x0400)
#define TPM_TOPALIGN 0x0000L
#define TPM_VCENTERALIGN 0x0010L
#define TPM_BOTTOMALIGN 0x0020L
#define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
#define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
#define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
#define TPM_RETURNCMD 0x0100L
//#endif WINVER >= 0x0400
//#if(WINVER >= 0x0500)
#define TPM_RECURSE 0x0001L
//#endif //WINVER >= 0x0500
WINUSERAPI BOOL WINAPI DrawIcon(HDC hDC,int X,int Y,HICON hIcon);
#define DT_TOP 0x00000000
#define DT_LEFT 0x00000000
#define DT_CENTER 0x00000001
#define DT_RIGHT 0x00000002
#define DT_VCENTER 0x00000004
#define DT_BOTTOM 0x00000008
#define DT_WORDBREAK 0x00000010
#define DT_SINGLELINE 0x00000020
#define DT_EXPANDTABS 0x00000040
#define DT_TABSTOP 0x00000080
#define DT_NOCLIP 0x00000100
#define DT_EXTERNALLEADING 0x00000200
#define DT_CALCRECT 0x00000400
#define DT_NOPREFIX 0x00000800
#define DT_INTERNAL 0x00001000
//#if(WINVER >= 0x0400)
#define DT_EDITCONTROL 0x00002000
#define DT_PATH_ELLIPSIS 0x00004000
#define DT_END_ELLIPSIS 0x00008000
#define DT_MODIFYSTRING 0x00010000
#define DT_RTLREADING 0x00020000
#define DT_WORD_ELLIPSIS 0x00040000
typedef struct tagDRAWTEXTPARAMS
{
UINT cbSize;
int iTabLength;
int iLeftMargin;
int iRightMargin;
UINT uiLengthDrawn;
} DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
WINUSERAPI int WINAPI DrawText(HDC hDC,LPCSTR lpString,int nCount,
LPRECT lpRect,UINT uFormat);
/* Monolithic state-drawing routine */
/* Image type */
#define DST_COMPLEX 0x0000
#define DST_TEXT 0x0001
#define DST_PREFIXTEXT 0x0002
#define DST_ICON 0x0003
#define DST_BITMAP 0x0004
/* State type */
#define DSS_NORMAL 0x0000
#define DSS_UNION 0x0010 /* Gray string appearance */
#define DSS_DISABLED 0x0020
#define DSS_DEFAULT 0x0040
#define DSS_MONO 0x0080
#define DSS_HIDEPREFIX 0x0200
#define DSS_PREFIXONLY 0x0400
#define DSS_RIGHT 0x8000
WINUSERAPI BOOL WINAPI DrawState(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT);
WINUSERAPI LONG WINAPI TabbedTextOut(HDC hDC,int X,int Y,LPCSTR lpString,
int nCount,int nTabPositions,LPINT lpnTabStopPositions,int nTabOrigin);
WINUSERAPI DWORD WINAPI GetTabbedTextExtent(HDC hDC,LPCSTR lpString,int nCount,
int nTabPositions,LPINT lpnTabStopPositions);
WINUSERAPI BOOL WINAPI UpdateWindow(HWND hWnd);
WINUSERAPI HWND WINAPI SetActiveWindow(HWND hWnd);
WINUSERAPI HWND WINAPI GetForegroundWindow(VOID);
WINUSERAPI BOOL WINAPI PaintDesktop(HDC hdc);
WINUSERAPI BOOL WINAPI SetForegroundWindow(HWND hWnd);
WINUSERAPI HWND WINAPI WindowFromDC(HDC hDC);
WINUSERAPI HDC WINAPI GetDC(HWND hWnd);
WINUSERAPI HDC WINAPI GetDCEx(HWND hWnd ,HRGN hrgnClip,DWORD flags);
/*GetDCEx() flags */
#define DCX_WINDOW 0x00000001L
#define DCX_CACHE 0x00000002L
#define DCX_NORESETATTRS 0x00000004L
#define DCX_CLIPCHILDREN 0x00000008L
#define DCX_CLIPSIBLINGS 0x00000010L
#define DCX_PARENTCLIP 0x00000020L
#define DCX_EXCLUDERGN 0x00000040L
#define DCX_INTERSECTRGN 0x00000080L
#define DCX_EXCLUDEUPDATE 0x00000100L
#define DCX_INTERSECTUPDATE 0x00000200L
#define DCX_LOCKWINDOWUPDATE 0x00000400L
#define DCX_VALIDATE 0x00200000L
WINUSERAPI HDC WINAPI GetWindowDC(HWND hWnd);
WINUSERAPI int WINAPI ReleaseDC(HWND hWnd,HDC hDC);
WINUSERAPI HDC WINAPI BeginPaint(HWND hWnd,LPPAINTSTRUCT lpPaint);
WINUSERAPI BOOL WINAPI EndPaint(HWND hWnd,CONST PAINTSTRUCT *lpPaint);
WINUSERAPI BOOL WINAPI GetUpdateRect(HWND hWnd,LPRECT lpRect,BOOL bErase);
WINUSERAPI int WINAPI GetUpdateRgn(HWND hWnd,HRGN hRgn,BOOL bErase);
WINUSERAPI int WINAPI SetWindowRgn(HWND hWnd,HRGN hRgn,BOOL bRedraw);
WINUSERAPI int WINAPI GetWindowRgn(HWND hWnd,HRGN hRgn);
WINUSERAPI int WINAPI ExcludeUpdateRgn(HDC hDC,HWND hWnd);
WINUSERAPI BOOL WINAPI InvalidateRect(HWND hWnd ,CONST RECT *lpRect,BOOL bErase);//lpRect必须为窗口坐标。
WINUSERAPI BOOL WINAPI InvalidateRgn(HWND hWnd,HRGN hRgn,BOOL bErase);
WINUSERAPI BOOL WINAPI RedrawWindow(HWND hWnd,CONST RECT *lprcUpdate,HRGN hrgnUpdate,UINT flags);
/* RedrawWindow() flags */
#define RDW_INVALIDATE 0x0001
#define RDW_INTERNALPAINT 0x0002
#define RDW_ERASE 0x0004
#define RDW_VALIDATE 0x0008
#define RDW_NOINTERNALPAINT 0x0010
#define RDW_NOERASE 0x0020
#define RDW_NOCHILDREN 0x0040
#define RDW_ALLCHILDREN 0x0080
#define RDW_UPDATENOW 0x0100
#define RDW_ERASENOW 0x0200
#define RDW_FRAME 0x0400
#define RDW_NOFRAME 0x0800
/* LockWindowUpdate API */
WINUSERAPI BOOL WINAPI LockWindowUpdate(HWND hWndLock);
WINUSERAPI BOOL WINAPI ScrollWindow(HWND hWnd,int XAmount,int YAmount,
CONST RECT *lpRect,CONST RECT *lpClipRect);
WINUSERAPI BOOL ScrollWindowEx(HWND hWnd,int dx,int dy, // amount of vertical scrolling
CONST RECT *prcScroll,// address of structure with scroll rectangle
CONST RECT *prcClip,// address of structure with clip rectangle
HRGN hrgnUpdate, // handle to update region
LPRECT prcUpdate, // address of structure for update rectangle
UINT flags // scrolling flags
);
WINUSERAPI BOOL WINAPI ScrollDC(HDC hDC,int dx,int dy,
CONST LPRECT lprcScroll,CONST LPRECT lprcClip ,
HRGN hrgnUpdate,LPRECT lprcUpdate);
#define SW_SCROLLCHILDREN 0x0001 /* Scroll children within *lprcScroll. */
#define SW_INVALIDATE 0x0002 /* Invalidate after scrolling */
#define SW_ERASE 0x0004 /* If SW_INVALIDATE, don't send WM_ERASEBACKGROUND */
//#if(WINVER >= 0x0500)
#define SW_SMOOTHSCROLL 0x0010 /* Use smooth scrolling */
//#endif //WINVER >= 0x0500
WINUSERAPI int WINAPI SetScrollPos(HWND hWnd,int nBar,int nPos,BOOL bRedraw);
WINUSERAPI int WINAPI GetScrollPos(HWND hWnd,int nBar);
WINUSERAPI BOOL WINAPI SetScrollRange(HWND hWnd,int nBar,int nMinPos,int nMaxPos,BOOL bRedraw);
WINUSERAPI BOOL WINAPI GetScrollRange(HWND hWnd,int nBar,LPINT lpMinPos,LPINT lpMaxPos);
WINUSERAPI BOOL WINAPI ShowScrollBar(HWND hWnd,int wBar,BOOL bShow);
WINUSERAPI BOOL WINAPI EnableScrollBar(HWND hWnd,UINT wSBflags,UINT wArrows);
/* EnableScrollBar() flags*/
#define ESB_ENABLE_BOTH 0x0000
#define ESB_DISABLE_BOTH 0x0003
#define ESB_DISABLE_LEFT 0x0001
#define ESB_DISABLE_RIGHT 0x0002
#define ESB_DISABLE_UP 0x0001
#define ESB_DISABLE_DOWN 0x0002
#define ESB_DISABLE_LTUP ESB_DISABLE_LEFT
#define ESB_DISABLE_RTDN ESB_DISABLE_RIGHT
WINUSERAPI BOOL WINAPI SetWindowText(HWND hWnd,LPCSTR lpString);
WINUSERAPI int WINAPI GetWindowText(HWND hWnd,LPSTR lpString,int nMaxCount);
WINUSERAPI int WINAPI GetWindowTextLength(HWND hWnd);
WINUSERAPI BOOL WINAPI GetClientRect(HWND hWnd,LPRECT lpRect);
WINUSERAPI BOOL WINAPI GetWindowRect(HWND hWnd,LPRECT lpRect);
WINUSERAPI BOOL WINAPI AdjustWindowRect(LPRECT lpRect,DWORD dwStyle,BOOL bMenu);
WINUSERAPI BOOL WINAPI AdjustWindowRectEx(LPRECT lpRect,DWORD dwStyle,BOOL bMenu,DWORD dwExStyle);
#define HELPINFO_WINDOW 0x0001
#define HELPINFO_MENUITEM 0x0002
typedef struct tagHELPINFO /* Structure pointed to by lParam of WM_HELP */
{
UINT cbSize; /* Size in bytes of this struct */
int iContextType; /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */
int iCtrlId; /* Control Id or a Menu item Id. */
HANDLE hItemHandle; /* hWnd of control or hMenu. */
DWORD dwContextId; /* Context Id associated with this item */
POINT MousePos; /* Mouse Position in screen co-ordinates */
} HELPINFO,*LPHELPINFO;
WINUSERAPI BOOL WINAPI SetWindowContextHelpId(HWND, DWORD);
WINUSERAPI DWORD WINAPI GetWindowContextHelpId(HWND);
WINUSERAPI BOOL WINAPI SetMenuContextHelpId(HMENU, DWORD);
WINUSERAPI DWORD WINAPI GetMenuContextHelpId(HMENU);
/* MessageBox() Flags */
#define MB_OK 0x00000000L
#define MB_OKCANCEL 0x00000001L
#define MB_ABORTRETRYIGNORE 0x00000002L
#define MB_YESNOCANCEL 0x00000003L
#define MB_YESNO 0x00000004L
#define MB_RETRYCANCEL 0x00000005L
#define MB_ICONHAND 0x00000010L
#define MB_ICONQUESTION 0x00000020L
#define MB_ICONEXCLAMATION 0x00000030L
#define MB_ICONASTERISK 0x00000040L
//#if(WINVER >= 0x0400)
#define MB_USERICON 0x00000080L
#define MB_ICONWARNING MB_ICONEXCLAMATION
#define MB_ICONERROR MB_ICONHAND
//#endif //WINVER >= 0x0400
#define MB_ICONINFORMATION
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -