有可能是申明的问题,把那个Alias "Shell_NotifyIconA" 去掉,直接用Shell_NotifyIconA 如果情况相反的话就这样
Declear Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (...) As Long
如果你是从api文本浏览器中直接拷贝过来的,就会报这个错误。这个是api浏览器的一个bug.
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias " Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Shell_NotifyIconA前多了一个空格,将之删除就行了。