炫彩界面库论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 2427|回复: 2

XMenuBar_AddMenuItem的bug

[复制链接]

该用户从未签到

发表于 2011-12-3 09:05:23 | 显示全部楼层 |阅读模式
本帖最后由 Pmdsplayer 于 2011-12-3 09:06 编辑

XMenuBar_AddMenuItem
1.34可用
1.35(新版)窗口会崩溃
  • TA的每日心情
    开心
    2022-1-9 18:18
  • 发表于 2011-12-3 18:11:16 | 显示全部楼层
    你自己对比下代码,代码如下,运行正常.

    1. HELE hMenuBar=NULL;
    2. bool CALLBACK My_EventBtnClick(HELE hEle,HELE hEventEle)
    3. {
    4.         //菜单条操作
    5.         XMenuBar_DeleteMenuItem(hMenuBar,0,202);
    6.         return false;
    7. }

    8. //菜单条
    9. int APIENTRY _tWinMain(HINSTANCE hInstance,  HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
    10. {
    11.         XInitXCGUI();

    12.         //创建窗口
    13.         HWINDOW hWindow=XWnd_CreateWindow(400,200,300,200,L"炫彩界面库-窗口");
    14.         XWnd_ShowWindow(hWindow,SW_SHOW);

    15.         //创建菜单条
    16.         hMenuBar=XMenuBar_Create(10,10,300,30,hWindow);
    17.         
    18.         //添加菜单条按钮
    19.         XMenuBar_AddButton(hMenuBar,L"文件");
    20.         XMenuBar_AddButton(hMenuBar,L"编辑");
    21.         XMenuBar_AddButton(hMenuBar,L"视图");

    22.         //添加弹出菜单项
    23.         XMenuBar_AddMenuItemImage(hMenuBar,0,201,L"111",XMENU_ROOT,NULL,L"image\\149.gif");
    24.         XMenuBar_AddMenuItemImage(hMenuBar,0,202,L"222",XMENU_ROOT,NULL,L"image\\150.gif");
    25.         XMenuBar_AddMenuItem(hMenuBar,0,-1,NULL,XMENU_ROOT,XM_SEPARATOR);
    26.         XMenuBar_AddMenuItemImage(hMenuBar,0,203,L"333",XMENU_ROOT,NULL,L"image\\151.gif");

    27.         XMenuBar_AddMenuItem(hMenuBar,1,204,L"444");
    28.         XMenuBar_AddMenuItem(hMenuBar,1,205,L"555");
    29.         XMenuBar_AddMenuItem(hMenuBar,1,206,L"666");

    30.         XMenuBar_AddMenuItem(hMenuBar,2,207,L"777");
    31.         XMenuBar_AddMenuItem(hMenuBar,2,208,L"888");
    32.         XMenuBar_AddMenuItem(hMenuBar,2,209,L"999");


    33.         XMenuBar_AddMenuItem(hMenuBar,0,217,L"3-11",203);
    34.         XMenuBar_AddMenuItem(hMenuBar,0,218,L"3-22",203);
    35.         XMenuBar_AddMenuItem(hMenuBar,0,219,L"3-33",203);

    36.         HELE hButton=XBtn_Create(10,10,60,20,L"按钮",hWindow);
    37.         XEle_RegisterEvent(hButton,XE_BNCLICK,My_EventBtnClick);

    38.         XRunXCGUI();

    39.         return 0;
    40. }
    复制代码
    QQ截图未命名.jpg

    该用户从未签到

     楼主| 发表于 2011-12-4 13:02:35 | 显示全部楼层
    谢谢您的解答~!
    您需要登录后才可以回帖 登录 | 加入我们

    本版积分规则

    QQ|Archiver|手机版|小黑屋|炫彩界面库 ( 鄂ICP备2023014763号-1 )

    GMT+8, 2024-5-5 17:14 , Processed in 0.071678 second(s), 21 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表