首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

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

2012-02-24 
自定义工具栏对话框 闪一下 - C++ Builder / Windows SDK/APIMSDN中自定义工具栏对话框可以弹出,但是我双

自定义工具栏对话框 闪一下 - 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,不用这么麻烦

热点排行