读书人

自定义工具栏对话框 闪一下,该如何解决

发布时间: 2012-02-24 16:30:38 作者: rapoo

自定义工具栏对话框 闪一下 - C++ Builder / Windows SDK/API
MSDN中自定义工具栏对话框可以弹出,但是我双击工具栏,该对话框闪了一下,并没有显示。这是怎么回事?

C/C++ code
LRESULT MsgNotify(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam){    static UINT        i=0;    LPNMHDR         lpnmhdr;       lpnmhdr = (LPNMHDR)lparam;      if (lpnmhdr->code == TBN_QUERYINSERT || lpnmhdr->code ==        TBN_QUERYDELETE)    {     return TRUE;    }            if (lpnmhdr->code == TBN_GETBUTTONINFO)    {        LPTBNOTIFY lpTbNotify = (LPTBNOTIFY)lparam;        char  szBuffer [20];                   // 20 = total number of buttons.        // tbButton and tbButtonNew send information about        // the other 12 buttons in tbButtonNew.                if (lpTbNotify->iItem < 12)            {                                       lpTbNotify->tbButton = tbButtonNew[lpTbNotify->iItem];         LoadString(g_hInst,                    4000+ lpTbNotify->iItem,                      szBuffer, sizeof(szBuffer));         lstrcpy (lpTbNotify->pszText, szBuffer);         lpTbNotify->cchText = sizeof (szBuffer);         return TRUE;        }     else        return 0;    }    return 0;}


[解决办法]
用什么编写的?
如果用VCL,不用这么麻烦

读书人网 >C++ Builder

热点推荐