窗口最小化到系统托盘程序有一个错误,帮忙看看
这是源代码.386
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
include gdi32.inc
includelib gdi32.lib
include shell32.inc
includelib shell32.lib
ICO_MAIN equ 0
IDM_MAIN equ 1000h
IDM_OPEN equ 1001h
IDM_EXIT equ 1002h
IDM_ABOUT equ 1003h
WM_SHELLNOTIFY equ WM_USER+5
.data?
hInstance dd ?
hWinMain dd ?
hMenu dd ?
.const
szClassName db 'myclass',0
szCaptionMain db 'shell_notifyicon',0
szText db 'Hello shell_nontifyicon',0
.code
_Quit proc
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,NULL
ret
_Quit endp
_ProcWinMain proc uses ebx edi esi,hWnd,uMsg,wParam,lParam
local @pt:POINT
local @stNote:NOTIFYICONDATA
mov eax,uMsg
.if eax==WM_SIZE
.if wParam==SIZE_MINIMIZED
mov @stNote.cbSize,sizeof NOTIFYICONDATA
push hWnd
pop @stNote.hWnd
mov @stNote.uID,ICO_MAIN
mov @stNote.uFlags,NIF_ICON OR NIF_MESSAGE OR NIF_TIP
mov @stNote.uCallbackMessage,WM_SHELLNOTIFY
invoke LoadIcon,hInstance,ICO_MAIN
mov @stNote.hIcon,eax
invoke lstrcpy,addr @stNote.szTip,addr szText
invoke ShowWindow,hWnd,SW_HIDE
invoke Shell_NotifyIcon,NIM_ADD,addr @stNote
.endif
.elseif eax==WM_CLOSE
call _Quit
.elseif eax==WM_SHELLNOTIFY
.if wParam==ICO_MAIN
.if lParam==WM_RBUTTONDOWN
invoke GetCursorPos,addr @pt
invoke SetForegroundWindow,hWnd
invoke TrackPopupMenu,hMenu,TPM_LEFTALIGN,addr @pt.x,addr @pt.y,NULL,hWnd,NULL
invoke PostMessage,hWnd,WM_NULL,0,0
.elseif lParam==WM_LBUTTONDBLCLK
invoke SendMessage,hWnd,WM_COMMAND,IDM_OPEN,0
.endif
.endif
.elseif eax==WM_COMMAND
mov eax,wParam
movzx eax,ax
.if eax==IDM_EXIT
call _Quit
.elseif eax==IDM_ABOUT
invoke MessageBox,hWinMain,offset szText,offset szCaptionMain,MB_OK
.elseif eax==IDM_OPEN
invoke Shell_NotifyIcon,NIM_DELETE,addr @stNote
invoke ShowWindow,hWnd,SW_SHOWNORMAL
.endif
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
_ProcWinMain endp
_WinMain proc
local @stWndClass:WNDCLASSEX
local @stMsg:MSG
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke LoadMenu,hInstance,IDM_MAIN
mov hMenu,eax
invoke RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
invoke LoadIcon,hInstance,ICO_MAIN
mov @stWndClass.hIcon,eax
mov @stWndClass.hIconSm,eax
invoke LoadCursor,0,IDC_ARROW
mov @stWndClass.hCursor,eax
push hInstance
pop @stWndClass.hInstance
mov @stWndClass.cbSize,sizeof WNDCLASSEX
mov @stWndClass.style,CS_HREDRAW or CS_VREDRAW
mov @stWndClass.lpfnWndProc,offset _ProcWinMain
mov @stWndClass.hbrBackground,COLOR_WINDOW+1
mov @stWndClass.lpszClassName,offset szClassName
invoke RegisterClassEx,addr @stWndClass
invoke CreateWindowEx,WS_EX_CLIENTEDGE,offset szClassName,\
offset szCaptionMain,\
WS_OVERLAPPED+WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX+WS_VISIBLE,\
100,100,400,300,NULL,hMenu,hInstance,NULL
mov hWinMain,eax
invoke ShowWindow,hWinMain,SW_SHOWNORMAL
invoke UpdateWindow,hWinMain
.while TRUE
invoke GetMessage,addr @stMsg,NULL,0,0
.break .if eax==0
invoke TranslateMessage,addr @stMsg
invoke DispatchMessage,addr @stMsg
.endw
ret
_WinMain endp
start:
call _WinMain
invoke ExitProcess,NULL
end start
一直报mov @stNote.uID,ICO_MAIN
error A2006: undefined symbol这个错误,不知道是怎么回事,老大帮忙看看,多谢了。