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

📄 extensions.h

📁 A arithmetical resolution about Hanoi tower . compiled by Visaul C++
💻 H
📖 第 1 页 / 共 2 页
字号:
#if !defined (_EXTENSIONS_H_)
#define _EXTENSIONS_H_

#undef      GetWindowID
#define     GetWindowID(hwnd)            (int)(short)GetDlgCtrlID(hwnd)

#undef      HANDLE_WM_GETDLGCODE
#define     HANDLE_WM_GETDLGCODE(hwnd, wParam, lParam, fn) \
                    (LRESULT)(DWORD)(UINT)(fn)((hwnd))
#undef      FORWARD_WM_GETDLGCODE
#define     FORWARD_WM_GETDLGCODE(hwnd, fn) \
                    (UINT)(DWORD)(fn)((hwnd), WM_GETDLGCODE, 0, 0)

#define HANDLE_WM_CAPTURECHANGED(hwnd, wParam, lParam, fn) \
      (LRESULT)(fn)((hwnd), (HWND) lParam)
#define FORWARD_WM_CAPTURECHANGED(hwnd, newWnd, fn) \
       (LRESULT)(fn)((hwnd), WM_CAPTURECHANGED, 0, (LPARAM)(HWND)(newWnd))

#define HANDLE_WM_CONTEXTMENU(hwnd, wParam, lParam, fn) \
    (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (HWND) wParam, (int)LOWORD(lParam), (int)HIWORD(lParam))
#define FORWARD_WM_CONTEXTMENU(hwnd, hwndCtl, xPos, yPos, fn) \
    (BOOL)(DWORD)(fn)((hwnd), WM_CONTEXTMENU, (WPARAM)(HWND)hwndCtl, MAKELPARAM((xPos), (yPos)))

#define HANDLE_WM_DISPLAYCHANGE(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (UINT)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)),0L)
#define FORWARD_WM_DISPLAYCHANGE(hwnd, cBitsPerPixel, cxScreen, cyScreen, fn) \
    (void)(fn)((hwnd), WM_DISPLAYCHANGE, (WPARAM)(UINT)(cBitsPerPixel), MAKELPARAM((cxScreen), (cyScreen)))

#define HANDLE_WM_ENTERMENULOOP(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (BOOL)wParam), 0L)
#define FORWARD_WM_ENTERMENULOOP(hwnd, isTrackPopup, fn) \
    (void)(fn)((hwnd), WM_ENTERMENULOOP, (WPARAM)(isTrackPopup), 0L)

#define HANDLE_WM_EXITMENULOOP(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (BOOL)wParam), 0L)
#define FORWARD_WM_EXITMENULOOP(hwnd, isTrackPopup, fn) \
    (void)(fn)((hwnd), WM_EXITMENULOOP, (WPARAM)(isTrackPopup), 0L)

#define HANDLE_WM_ENTERSIZEMOVE(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd)), 0L)
#define FORWARD_WM_ENTERSIZEMOVE(hwnd, fn) \
    (void)(fn)((hwnd), WM_ENTERSIZEMOVE, 0, 0)

#define HANDLE_WM_EXITSIZEMOVE(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd)), 0L)
#define FORWARD_WM_EXITSIZEMOVE(hwnd, fn) \
    (void)(fn)((hwnd), WM_EXITSIZEMOVE, 0, 0)

#define HANDLE_WM_HELP(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (LPHELPINFO)(lParam)),0L)
#define FORWARD_WM_HELP(hwnd, lphi, fn) \
    (void)(fn)((hwnd),WM_HELP,(WPARAM)0,(LPARAM)(LPHELPINFO)(lphi))

#define HANDLE_WM_PRINTCLIENT(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (HDC)(wParam), (UINT)(lParam)),0L)
#define FORWARD_WM_PRINTCLIENT(hwnd, hdc, uFlags, fn) \
    (void)(fn)((hwnd),WM_PRINTCLIENT,(WPARAM)(HDC)(wParam),(LPARAM)(UINT)(uFlags))

#define HANDLE_WM_SETTINGCHANGE(hwnd, wParam, lParam, fn) \
    ((fn)((hwnd), (UINT)(wParam),(LPCTSTR)(lParam)),0L)
#define FORWARD_WM_SETTINGCHANGE(hwnd, uiFlag, pszMetrics, fn) \
    (void)(fn)((hwnd),WM_SETTINGCHANGE,(WPARAM)(UINT)uiFlag,(LPARAM)(LPCTSTR)pszMetrics)

#define HANDLE_WM_USERCHANGED(hwnd, wParam, lParam, fn) \
    ((fn)(hwnd),0L)
#define FORWARD_WM_USERCHANGED(hwnd, fn) \
    (void)(fn)((hwnd),WM_USERCHANGED,(WPARAM)0,(LPARAM)0)

#define Button_Click(hwnd) \
    (void)SendMessage((hwnd), BM_CLICK, 0, 0)

#define Edit_GetThumb(hwnd) \
    (int)SendMessage((hwnd), EM_GETTHUMB, 0, 0)

#define Edit_CharFromPos(hwnd, x, y) \
    (int)SendMessage((hwnd), EM_CHARFROMPOS, 0, MAKELPARAM((x), (y)))

#define Edit_GetWordBreakProcEx(hwnd) \
    ((WORDBREAKPROCEX)SendMessage((hwndCtl), EM_GETWORDBREAKPROCEX, 0, 0))

#define Edit_LineScroll(hwnd, hscroll, vscroll) \
    (BOOL)SendMessage((hwnd), (WPARAM)(int)(hScroll), (LPARAM)(int)(vscroll))

#define Edit_PosFromChar(hwnd, pt, pos) \
    (void)SendMessage((hwnd), EM_POSFROMCHAR, (WPARAM)(LPPOINT)(pt), (LPARAM)(int)(pos))

#define Edit_SetMargins(hwnd, which, left, right) \
   (void)SendMessage((hwnd), EM_SETMARGINS, (WPARAM)(which), MAKELPARAM((left), (right)))

#define Edit_SetWordBreakProcEx(hwndCtl, wbp) \
    ((void)SendMessage((hwndCtl), EM_SETWORDBREAKPROCEX, 0L, (LPARAM)(EDITWORDBREAKPROCEX)(wbp)))

#define Static_SetImage(hwnd, imagetype, himage) \
    (HANDLE)SendMessage((hwnd), STM_SETIMAGE, (WPARAM)(imagetype), \
                              (LPARAM)(HANDLE)(himage))

#define Static_GetImage(hwnd, imagetype) \
    (HANDLE)SendMessage((hwnd), STM_GETIMAGE, (WPARAM)(imagetype), 0)
#define ListBox_AddFile(hwnd, filename) \
    (int)SendMessage((hwnd), LB_ADDFILE, 0, (LPARAM)(LPCTSTR)(filename))
#define ListBox_GetAnchorIndex(hwnd) \
   (int)SendMessage((hwnd), LB_GETANCHORINDEX, 0, 0)

#define ListBox_GetLocale(hwnd) \
   (LCID)SendMessage((hwnd), LB_GETLOCALE, 0, 0)

#define ListBox_InitStorage(hwnd, nItems, stringBytes) \
   (int)SendMessage((hwnd), LB_INITSTORAGE, (WPARAM)(int)(nItems), \
            (LPARAM)(int)(stringBytes))

#define ListBox_ItemFromPoint(hwnd, x, y) \
    (int)SendMessage((hwnd), LB_ITEMFROMPOINT, 0, MAKELONG((x), (y)))

#define ListBox_SelItemRangeEx(hwnd, first, last) \
    (int)SendMessage((hwnd), LB_SELITEMRANGEEX, (WPARAM)(int)(first), \
                (LPARAM)(int)(last))

#define ListBox_SetAnchorIndex(hwnd, index) \
    (int)SendMessage((hwnd), LB_SETANCHORINDEX, (WPARAM)(int)(index), 0)

#define ListBox_SetLocale(hwnd, locale) \
    (LCID)SendMessage((hwnd), LB_SETLOCALE, (WPARAM)(LCID)(locale), 0)

#define ComboBox_GetDroppedWidth(hwnd) \
    ((int)(DWORD)SendMessage((hwnd), CB_GETDROPPEDWIDTH, 0, 0))

#define ComboBox_GetLocale(hwnd) \
   (LCID)SendMessage((hwnd), CB_GETLOCALE, 0, 0)

#define ComboBox_GetTopIndex(hwndCtl) \
    ((int)(DWORD)SendMessage((hwndCtl), CB_GETTOPINDEX, 0L, 0L))

#define ComboBox_SetDroppedWidth(hwnd, width) \
    (int)SendMessage((hwnd), CB_SETDROPPEDWIDTH, (WPARAM)(int)width, 0)

#define ComboBox_SetHorizontalExtent(hwnd, width) \
    (void)SendMessage((hwnd), CB_SETHORIZONTALEXTENT, (WPARAM)(int)(width), 0)

#define ComboBox_SetLocale(hwnd, locale) \
    (LCID)SendMessage((hwnd), CB_SETLOCALE, (WPARAM)(LCID)(locale), 0)

#define ComboBox_SetTopIndex(hwndCtl, indexTop) \
    ((int)(DWORD)SendMessage((hwndCtl), CB_SETTOPINDEX, (WPARAM)(int)(indexTop), 0L))

#define Toolbar_AddBitmap(hwnd, nButtons, lptbab) \
    (int)SendMessage((hwnd),TB_ADDBITMAP,(WPARAM)(UINT)(nButtons),(LPARAM)(LPTBADDBITMAP)(lptbab))

#define Toolbar_AddButtons(hwnd, uNumButtons, lpButtons) \
    (BOOL)SendMessage((hwnd),TB_ADDBUTTONS,(WPARAM)(UINT)(uNumButtons),(LPARAM)(LPTBBUTTON)(lpButtons))

#define Toolbar_AddString(hwnd, hinst, idString) \
    (int)SendMessage((hwnd),TB_ADDSTRING,(WPARAM)(HINSTANCE)(hinst),(LPARAM)(LPCTSTR)(idString))

#define Toolbar_AutoSize(hwnd) \
    (void)SendMessage((hwnd),TB_AUTOSIZE,(WPARAM)0,(LPARAM)0)

#define Toolbar_ButtonCount(hwnd) \
    (UINT)SendMessage((hwnd),TB_BUTTONCOUNT,(WPARAM)0,(LPARAM)0)

#define Toolbar_ButtonStructSize(hwnd) \
    (void)SendMessage((hwnd),TB_BUTTONSTRUCTSIZE,(WPARAM)sizeof(TBBUTTON),(LPARAM)0)

#define Toolbar_ChangeBitmap(hwnd, idButton, iBitmap) \
    (BOOL)SendMessage((hwnd),TB_CHANGEBITMAP,(WPARAM)(int)(idButton),(LPARAM)(UINT)(iBitmap))

#define Toolbar_CheckButton(hwnd, idButton, fCheck) \
    (BOOL)SendMessage((hwnd),TB_CHECKBUTTON,(WPARAM)(int)(idButton),(LPARAM)(BOOL)(fCheck))

#define Toolbar_CommandToIndex(hwnd, idButton) \
    (UINT)SendMessage((hwnd),TB_COMMANDTOINDEX,(WPARAM)(int)(idButton),(LPARAM)0)

#define Toolbar_Customize(hwnd) \
    (void)SendMessage((hwnd),TB_CUSTOMIZE,(WPARAM)0,(LPARAM)0)

#define Toolbar_DeleteButton(hwnd, iButton) \
    (BOOL)SendMessage((hwnd),TB_DELETEBUTTON,(WPARAM)(UINT)(iButton),(LPARAM)0)

#define Toolbar_EnableButton(hwnd, idButton, fEnable) \
    (BOOL)SendMessage((hwnd),TB_ENABLEBUTTON,(WPARAM)(int)(idButton),(LPARAM)(BOOL)(fEnable))

#define Toolbar_GetBitmap(hwnd, idButton) \
    (UINT)SendMessage((hwnd),TB_GETBITMAP,(WPARAM)(int)(idButton),(LPARAM)0)

#define Toolbar_GetBitmapFlags(hwnd) \
    (UINT)SendMessage((hwnd),TB_GETBITMAPFLAGS,(WPARAM)0,(LPARAM)0)

#define Toolbar_GetButton(hwnd, iButton, lpButton) \
    (BOOL)SendMessage((hwnd),TB_GETBUTTON,(WPARAM)(UINT)(iButton),(LPARAM)(LPTBBUTTON)(lpButton))

#define Toolbar_GetButtonText(hwnd, idButton, lpszText) \
    (BOOL)SendMessage((hwnd),TB_GETBUTTONTEXT,(WPARAM)(int)(idButton),(LPARAM)(LPTSTR)(lpszText))

#define Toolbar_GetItemRect(hwnd, iButton, lprc) \
    (BOOL)SendMessage((hwnd),TB_GETITEMRECT,(WPARAM)(UINT)(iButton),(LPARAM)(LPRECT)(lprc))

#define Toolbar_GetRows(hwnd) \
    (UINT)SendMessage((hwnd),TB_GETROWS,(WPARAM)0,(LPARAM)0)

#define Toolbar_GetState(hwnd, idButton) \
    (int)SendMessage((hwnd),TB_GETSTATE,(WPARAM)(int)(idButton),(LPARAM)0)

#define Toolbar_GetToolTips(hwnd) \
    (HANDLE)SendMessage((hwnd),TB_GETTOOLTIPS,(WPARAM)0,(LPARAM)0)

⌨️ 快捷键说明

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