zoukankan      html  css  js  c++  java
  • Win32:即给编辑框添加新窗口过程,也保留原来的窗口过程属性


    WNDPROC wpOrigEditProc;

    LRESULT APIENTRY EditBoxProc(
        HWND hwndDlg,
        UINT uMsg,
        WPARAM wParam,
        LPARAM lParam)
    {
        HWND hwndEdit;

        switch(uMsg)
        {
            case WM_INITDIALOG:
                // Retrieve the handle to the edit control.
                hwndEdit = GetDlgItem(hwndDlg, ID_EDIT);

                // Subclass the edit control.
                wpOrigEditProc = (WNDPROC) SetWindowLong(hwndEdit,
                    GWL_WNDPROC, (LONG) EditSubclassProc);
                //
                // Continue the initialization procedure.
                //
                return TRUE;

            case WM_DESTROY:
                // Remove the subclass from the edit control.
                SetWindowLong(hwndEdit, GWL_WNDPROC,
                    (LONG) wpOrigEditProc);
                //
                // Continue the cleanup procedure.
                //
                break;
        }
        return FALSE;
            UNREFERENCED_PARAMETER(lParam);
    }

    // Subclass procedure
    LRESULT APIENTRY EditSubclassProc(
        HWND hwnd,
        UINT uMsg,
        WPARAM wParam,
        LPARAM lParam)
    {
        if (uMsg == WM_GETDLGCODE)
            return DLGC_WANTALLKEYS;

        return CallWindowProc(wpOrigEditProc, hwnd, uMsg,
            wParam, lParam);
    }

  • 相关阅读:
    ceph简易安装
    ceph安装
    nova计算节点部署
    onva控制节点部署
    nova介绍
    image部署
    glance镜像介绍
    keystone部署
    keystone介绍
    rabbimtq消息队列部署
  • 原文地址:https://www.cnblogs.com/shenchao/p/3117857.html
Copyright © 2011-2022 走看看