当前位置: 代码迷 >> PB >> 最小化到托盘后,加载图标失败;托盘显示乱码!该怎么解决
  详细解决方案

最小化到托盘后,加载图标失败;托盘显示乱码!该怎么解决

热度:130   发布时间:2016-04-29 09:12:34.0
最小化到托盘后,加载图标失败;托盘显示乱码!
运行后有两个问题
1、最小化时候提示:
应用程序或DLL E:\MyWork\card3C\green.ico 为无效的windows映像。请再检测一遍您的安装盘。
在托盘上无图标
2、鼠标方图标上显示乱码,根本不是我要的“for show”

代码如下:

string str_resource
long lng_handle

if commandtype=61472 then //最小化

str_resource = "green.ico"
lng_handle = loadlibrary ( str_resource )

//从指定的模块或应用程序实例中载入一个图标。
i_str_notifyicondata.hIcon = loadicon( lng_handle, 1000)
i_str_notifyicondata.uCallbackMessage = 1024
i_str_notifyicondata.szTip = "for show"
i_str_notifyicondata.hWnd = handle (this)
i_str_notifyicondata.cbSize = 188
i_str_notifyicondata.uID = 1
i_str_notifyicondata.uFlags = 7

//增加图标到任务栏
shell_notifyicon (0, i_str_notifyicondata )
this.hide()
freelibrary ( lng_handle )
return 1
end if

------解决方案--------------------
_str_notifyicondata.szTip = "for show" + char(0)
  相关解决方案