(转)将shell32.dll中的图标加载到弹出菜单中
By
admin
at 2021-08-26 • 0人收藏 • 922人看过
感谢群里: popy32 和 Mr.MAO 分享代码
import win.ui; /*DSG{{*/ var winform = win.form(text="aardio form";right=759;bottom=469) winform.add() /*}}*/ //导入库 import win.ui.menu; import win.image; winform.wndproc = function(hwnd,message,wParam,lParam){ select( message ) { case 0x205/*_WM_RBUTTONUP*/{ var x,y = win.getMessagePos(lParam); var hIcon = win.image.extractIcon("shell32.dll", 67, false) popmenu = win.ui.popmenu(winform) var num1 = popmenu.add( text = "新建"; bitmap = gdip.bitmap( hIcon , 1).copyHandle(); proc = function(id){ win.msgbox(id) }; ) popmenu.add() popmenu.add("退出",function(){ winform.close() }) popmenu.popup(x,y,false); ::DestroyIcon(hIcon) } else{ } } //无返回值则继续调用默认回调函数 } winform.show(); win.loopMessage();
登录后方可回帖