TC4.3 右键菜单

功能 右键菜单()
    var Mx,My  // 装载鼠标座标
    mouse.getmousepoint(Mx,My)     // 得到鼠标位置
    
    Hmnu=dllcall("user32.dll","long","CreatePopupMenu")  // 创建弹出式菜单
    dllcall("user32.dll","long","AppendMenuA","long",Hmnu,"long",0,"long",1,"char *","怀孕次数")
    dllcall("user32.dll","long","AppendMenuA","long",Hmnu,"long",0,"long",2,"char *","活产次数")
    //  添加菜单内容  注 :  第3个参数 1 是下一个函数返回的ID值 每次添加一个内容建议加+1(数字)   第4个参数 "菜单内容" 是显示的内容 可以随便更改
    //  如果有多个内容 请复制上面  更改返回的ID  和 显示的内容   
    返回的ID=dllcall("user32.dll","long","TrackPopupMenu","long",Hmnu,"long",256,"long",Mx,"long",My,"long",0,"long",window.getmyhwnd(),"long",0)
    // 显示弹出式菜单//没有选择返回0 
    help.messagebox(返回的ID)
功能结束
posted @ 2021-04-30 18:59  锡纸烫  阅读(109)  评论(0编辑  收藏  举报