;==============================================================================
;	    Test Department's WINDOWS 32 BIT x86 ASSEMBLY EXAMPLE	040
;==============================================================================

;==============================================================================
; ==> Part 040 : traybar icon with popup menu
;------------------------------------------------------------------------------
; First I want say that this win32asm example was made with the detailed help
; from Iczelion's win32asm tutorial 23 ( http://win32asm.cjb.net ).
; In WinMain we register and create our main window without a menubar.
; In the window procedure (WP1), responding to a WM_CREATE message, we create
; an empty popup menu ( API=CreatePopupMenu ).
; We also add three menu item strings ( API= AppendMenuA ).
; You can also add bitmaps, for more information take a look into Win32.HLP.
; The next thing to do is to react to a WM_SIZE message.
; If wParam contains SIZE_MINIMIZED message we fill a NOTIFYCONDATA structure
; with required parameters including the nid_uCallbackMessage parameter (500h)
; which is a free value of your choice.
; API "ShowWindow" function sets the specified window's show state to SW_HIDE.
; API=Shell_NotifyIconA sends a message to the system to add a taskbar icon.
; We react to our uMsg ( 500h ) checking the tray icon ID in wParam and the
; mouse message in lParam.
; We call API GetCursorPos to get the current cursor position.
; Also API TrackPopupMenuEx needs the x and y coordinates to display the menu.
; We must call SetForegroundWindow because only the foreground window can
; receive notifications from the popup menu !
; Now we are ready to display the popup menu using API TrackPopupMenuEx.
; "lpfnWndProc" is a pointer to the subroutine label "WindowProc" ( WP1 ) where
; all the action code for this main window resist.
; "lpfnWndProc" is part of WndClassEx structure used by API RegisterClassEx.

;==============================================================================
; Assembler directives
;------------------------------------------------------------------------------
.386			; specifies the processor our program want run on
.Model Flat ,StdCall	; always the same for Win95 (32 Bit)
option casemap:none	; case sensitive !!!

;==============================================================================
; Include all files where API functins resist you want use, set correct path
;------------------------------------------------------------------------------
include \masm32\include\windows.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\shell32.lib

;==============================================================================
; Declaration of used API functions,take a look into WIN32.HLP and *.inc files
;------------------------------------------------------------------------------
GetModuleHandleA	PROTO :DWORD
LoadIconA		PROTO :DWORD,:DWORD
LoadCursorA		PROTO :DWORD,:DWORD
RegisterClassExA	PROTO :DWORD
CreateWindowExA		PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,
			      :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
ShowWindow		PROTO :DWORD,:DWORD
UpdateWindow		PROTO :DWORD
CreatePopupMenu		PROTO
AppendMenuA 		PROTO :DWORD,:DWORD,:DWORD,:DWORD
DestroyMenu		PROTO :DWORD
Shell_NotifyIconA	PROTO :DWORD,:DWORD
GetCursorPos		PROTO :DWORD
SetForegroundWindow	PROTO :DWORD
TrackPopupMenuEx	PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
lstrcpyA		PROTO :DWORD,:DWORD
PostMessageA		PROTO :DWORD,:DWORD,:DWORD,:DWORD
GetMessageA 		PROTO :DWORD,:DWORD,:DWORD,:DWORD
TranslateMessage 	PROTO :DWORD
DispatchMessageA 	PROTO :DWORD
PostQuitMessage 	PROTO :DWORD
DefWindowProcA 		PROTO :DWORD,:DWORD,:DWORD,:DWORD
ExitProcess		PROTO :DWORD
MessageBoxA		PROTO :DWORD,:DWORD,:DWORD,:DWORD
DestroyWindow 		PROTO :DWORD
SendMessageA 		PROTO :DWORD,:DWORD,:DWORD,:DWORD

;==============================================================================
; .const 	= the constants area starts here,constants are defined & fixed
;------------------------------------------------------------------------------
.const
example_const		equ 0Ah		;not used, example only

;==============================================================================
; .Data		= the data area starts here, datas are defined but not fixed
;------------------------------------------------------------------------------
.Data
IconName		db "TDIcon",0		;icon name in rc file
ClassName		db "TDWinClass",0	;name of windows class
WindowName		db "Test Department",0	;window name titel bar
MB1Titel 		db "About",0		;message box name
MB1Text			db "Done by Test Department",13,10,13,10;msg. box text
			db "with very detailed help from",13,10,13,10;
			db "Iczelion's win32asm tut 23",0	;
Restore			db "Restore",0		;
About			db "About",0		;
Exit			db "Exit",0		;
hpopup			dd 0h			;handle of pop-up menu

; - WndClassEx Structure ( API=RegisterClassExA ) -
cbSize			dd 0h		;size in bytes of this structure
style			dd 0h		;window style
lpfnWndProc		dd 0h		;address of user proc function
cbclsExtra		dd 0h		;extra bytes to allocate set to 0
cbWndExtra		dd 0h		;extra bytes class directive, rc file
hInstance		dd 0h		;program handle(API=GetModuleHandleA)
hIcon			dd 0h		;handle of icon (API=LoadIconA)
hcursor			dd 0h		;handle of cursor (API=LoadCursor)
hbrBackground		dd 0h		;background color, 0=transparent
lpszMenuName 		dd 0h		;name of menu class in resource file
lpszClassName		dd 0h		;name of windows this window class
hIconSm			dd 0h		;iconhandle 0=search in resource file

; - Push Parameter done by lpfnWndProc Function ( API=RegisterClassExA )
WP1_CallBack		dd 0h		;return address of calling routine
WP1_hWnd		dd 0h		;handle of window who receives message
WP1_uMsg		dd 0h		;the message number 
WP1_wParam		dd 0h		;extra info about the message 
WP1_lParam		dd 0h		;extra info about the message 

; - Msg Structure ( API=GetMessageA ) - member POINT = POINT structure
hWnd			dd 0h		;handle of window who receives message
message			dd 0h		;the message number
wParam			dd 0h		;extra info about the message
lParam			dd 0h		;extra info about the message
time			dd 0h		;time the message was posted
xpt			dd 0h		;cursor x-position, POINT struc
ypt			dd 0h		;cursor x-position, POINT struc

; - NOTIFYICONDATA Structure ( API=Shell_NotifyIcon ) -
nid_cbSize		dd 0h		;size of (NOTIFYICONDATA)
nid_hWnd		dd 0h		;handle for icon notification messages
nid_uID			dd 0h		;Application-defined ID taskbar icon
nid_uFlags		dd 0h		;flags which structure data are valid
nid_uCallbackMessage	dd 0h		;identifier for notification messages
nid_hIcon		dd 0h		;handle icon to add, modify or delete
nid_szTip		db 64 dup(0)	;tooltip text displays for taskbar icon


; - POINT Structure ( API=GetCursorPos ) -
point_xpt		dd 0h		;cursor x-position, POINT struc
point_ypt		dd 0h		;cursor x-position, POINT struc

;==============================================================================
; .Data?	= the data? area starts here, not defined and not fixed
;------------------------------------------------------------------------------
.data?
example_data?		dd ?		;not used, example only

;==============================================================================
; .CODE		=our code area starts here	Main=label of our program code
;------------------------------------------------------------------------------
.Code
Main:

;==============================================================================
; Always get your program ID first (API=GetModuleHandleA)
;------------------------------------------------------------------------------
push	0h				;lpModuleHandle, 0=get program handle
call 	GetModuleHandleA		;- API Function -
mov	hInstance,eax			;return value in eax=handle of program

;==============================================================================
; The API function "RegisterClassExA" registers a window class
; This API needs a "WNDCLASSEX" structure so we fill it with correct values
;------------------------------------------------------------------------------
mov	cbSize,30h			;size in bytes of WNDCLASSEX structure
mov	style,3h			;window style
mov	lpfnWndProc,OFFSET WP1		;address of user lpfnWndProc function
mov	cbclsExtra,0h			;extra bytes to allocate set to 0
mov	cbWndExtra,0h			;class directive in rc file
mov	hbrBackground,2h		;background,1=background(parameter+1)
mov	lpszMenuName,0h			;menu name in resource file,0=no menu
mov	lpszClassName,OFFSET ClassName	;name of windows class
mov	hIconSm,0h			;iconhandle 0=search in rc file
;------------------------------------------------------------------------------
; API "LoadIconA" loads an icon defined in the resource file and store the
; handle in the "WNDCLASSEX" structure
;------------------------------------------------------------------------------
push	OFFSET IconName 		;icon-string or icon resource id
push	hInstance			;our program handle
call 	LoadIconA			;- API Function -
mov	hIcon,eax			;handle of newly loaded icon
;------------------------------------------------------------------------------
; API "LoadCursorA" loads a default system cursor, in this case we must set
; hInstance to 0 and lpCursorName to a default system cursor value, here 32512
; Then we store the cursor handle in the "WNDCLASSEX" structure
;------------------------------------------------------------------------------
push	32512				;lpCursorName,default value in dezimal
push	0h				;hInstance, 0=default system cursor
call	LoadCursorA			;- API Function -
mov	hcursor,eax			;handle of the cursor
;------------------------------------------------------------------------------
; Now, after filled the "WNDCLASSEX" structure we call API "RegisterClassEx"
;------------------------------------------------------------------------------
push	OFFSET cbSize			;pointer to WNDCLASSEX structure
call 	RegisterClassExA		;- API Function -

;==============================================================================
; API "CreateWindowExA" creates an overlapped, pop-up, or child window with an
; extended style. The return value in EAX is the handle of the new window.
; This API sends a WM_CREATE message to the window procedure (WP1).
;------------------------------------------------------------------------------
push	0h				;lpParam, extra pointer data 0=no data
push	hInstance			;hInstance, handle of our program
push 	0h				;hMenu, handle window menu 0=class menu
push	0h				;hWndParent, handle parent window 0=no
push	00000080h			;intnHeight, window height pixel
push	000000C0h			;intnWidth, window width pixel
push	00000098h			;inty, vertical position window
push	00000210h			;intx, horizontal position window
push	04CA0000h			;dwStyle, look into WIN32.HLP
push	OFFSET WindowName		;lpWindowName, pointer to window name
push	OFFSET ClassName		;lpClassName, pointer to class name
push	0300h				;dwExStyle, extra window style 0=no
call	CreateWindowExA			;- API Function -
mov	hWnd,eax			;hwnd,return value=handle of window

;==============================================================================
; API "ShowWindow" function sets the specified window's show state. 
;------------------------------------------------------------------------------
push 	1h				;nCmdShow, show state 1=SW_SHOWNORMAL
push 	hWnd				;hwnd, handle of window
call 	ShowWindow			;- API Function -

;==============================================================================
; API "UpdateWindow" updates the area of the specified window by sending a
; WM_PAINT message to the window if the window's update region is not empty.
;------------------------------------------------------------------------------
push 	hWnd				;hwnd, handle of window
call	UpdateWindow			;- API Function -

;==============================================================================
; API "GetMessageA" retrieves a message & places it in the specified structure.
;------------------------------------------------------------------------------
LoopGetMessage:
push	0h				;wMsgFilterMax, highest message value
push	0h				;wMsgFilterMin, lowest message value
push	0h				;hWnd, handle of window who gets msg.
push	OFFSET hWnd			;lpMsg, pointer to MSG structure
call	GetMessageA			;- API Function -
cmp	eax,0h				;check if return value=0 (exit)
je	ExitPrg				;if return value is 0 goto LABEL

;==============================================================================
; API "TranslateMessage" translates key code into ASCII character messages
;------------------------------------------------------------------------------
push	OFFSET hWnd			;lpMSG, pointer to msg structure
call	TranslateMessage		;- API Function - keyboard code

;==============================================================================
; API "DispatchMessageA" function dispatches a message to a window procedure.
;------------------------------------------------------------------------------
push	OFFSET hWnd			;lpMSG, pointer to msg structure
call	DispatchMessageA		;- API Function -
jmp	LoopGetMessage			;check for message again, goto LABEL

;==============================================================================
; Next we terminate our program (API=ExitProcess)
;------------------------------------------------------------------------------
ExitPrg:
push	hInstance			;push our programm handle to exit
call	ExitProcess			;- API Function -

;##############################################################################
;==============================================================================
; This is the Window Procedure lpfnWndProc (API=RegisterClassExA) for this
; registered window.
; The WindowProc function is an application-defined callback function that
; processes messages sent to a window. 
; Here our code for checking the receiving messages resist.
; In the future it is the main work for us to react to the recieved messages.
; First we POP all parameter given by Windows from the stack and store them in
; variables for future use.
; !!!!! Next we PUSH the WP1_CallBack return address back to the stack !!!!!
; !!! WP1_CallBack must be avaible on the stack in this window procedure !!!
; It is also a good idea to PUSHAD all register, because than we are free to
; use all register in this window procedure.
; Before we leave this subroutine we must POPAD them back. 
;------------------------------------------------------------------------------
WP1:
pop 	WP1_CallBack			;POP return address lpfnWndProc
pop	WP1_hWnd			;handle of window who receives message
pop	WP1_uMsg			;the message number
pop	WP1_wParam			;extra info about the message
pop	WP1_lParam			;extra info about the message
push	WP1_CallBack			;PUSH return address lpfnWndProc !!!!!
pushad					;push all register to the stack

mov	eax,WP1_uMsg			;move the message number to eax
;==============================================================================
; WM_CREATE (value=01h) message received ?
;------------------------------------------------------------------------------
WP1_uMsg_01h:
cmp	eax,1h				;check if WM_CREATE message recieved
jne	WP1_uMsg_02h			;if not goto label
;------------------------------------------------------------------------------
; API "CreatePopupMenu" creates an empty popup menu
;------------------------------------------------------------------------------
call	CreatePopupMenu			;- API Function -
mov	hpopup,eax			;return value=handle of popup menu
;------------------------------------------------------------------------------
; API "AppendMenuA" appends a new menu item to the end of the specified menu
; uIDNewItem --> menu items ID's are a free value of your choice
;------------------------------------------------------------------------------
push	OFFSET Restore			;lpNewItem, menu item content
push	01h				;uIDNewItem,menu item id or menu handle
push	0h				;uFlags, menu item flags, 0h=MF_STRING
push	hpopup				;hMenu,	handle of popup menu
call	AppendMenuA			;- API Function -
;------------------------------------------------------------------------------
; API "AppendMenuA" appends a new menu item to the end of the specified menu
; uIDNewItem --> menu items ID's are a free value of your choice
;------------------------------------------------------------------------------
push	OFFSET About			;lpNewItem, menu item content
push	02h				;uIDNewItem,menu item id or menu handle
push	0h				;uFlags, menu item flags, 0h=MF_STRING
push	hpopup				;hMenu,	handle of popup menu
call	AppendMenuA			;- API Function -
;------------------------------------------------------------------------------
; API "AppendMenuA" appends a new menu item to the end of the specified menu
; uIDNewItem --> menu items ID's are a free value of your choice
;------------------------------------------------------------------------------
push	OFFSET Exit			;lpNewItem, menu item content
push	03h				;uIDNewItem,menu item id or menu handle
push	0h				;uFlags, menu item flags, 0h=MF_STRING
push	hpopup				;hMenu,	handle of popup menu
call	AppendMenuA			;- API Function -
jmp	WP1_return			;

;==============================================================================
; WM_DESTROY (value=02h) message received ?
;------------------------------------------------------------------------------
WP1_uMsg_02h:
cmp	eax,2h				;check if value=2h (WM_DESTROY)
jne	WP1_uMsg_05h			;if not 2h go to LABEL
;------------------------------------------------------------------------------
; API "DestroyMenu" destroys the popup menu
;------------------------------------------------------------------------------
push	hpopup				;hMenu, handle of popup menu
call	DestroyMenu			;- API Function -
;------------------------------------------------------------------------------
; API "PostQuitMessage" indicates to Windows a request to terminate
;------------------------------------------------------------------------------
popad					;pop all register back from stack
push	0h				;nExitCode, exit code=wParam
call 	PostQuitMessage			;- API Function -
xor	eax,eax				;set eax to 0 to exit our program
ret					;return to lpfnWndProc

;==============================================================================
; WM_SIZE (value=05h) message received ?
;------------------------------------------------------------------------------
WP1_uMsg_05h:
cmp	eax,5h				;check if value=5h (WM_SIZE)
jne	WP1_uMsg_0Fh			;if not 5h go to LABEL
mov	eax,WP1_wParam			;extra info about message
cmp	ax,01h				;SIZE_MINIMIZED=1h
jne	WP1_return			;if not 1h goto LABEL
mov	nid_cbSize,58h			;size of NOTIFYCONDATA structure
mov	eax,WP1_hWnd			;
mov	nid_hWnd,eax			;handle of window
mov	nid_uID,0h			;icon ID, a free value of your choice
mov	nid_uFlags,7h			;NIF_ICON=2h,NIF_MESSAGE=1h,NIF_TIP=4h
mov	nid_uCallbackMessage,500h	;message send to window on mouse events
mov	eax,hIcon			;we use the same icon handle loaded
mov	nid_hIcon,eax			;for the main window
;------------------------------------------------------------------------------
; API "lstrcpyA" copy's a string from source to destination. 
;------------------------------------------------------------------------------
push	OFFSET WindowName		;source address of icon tip string
push	OFFSET nid_szTip		;destination address in structure
call	lstrcpyA			;- API Function -
;------------------------------------------------------------------------------
; API "ShowWindow" function sets the specified window's show state. 
;------------------------------------------------------------------------------
push 	0h				;nCmdShow, show state 0h=SW_HIDE
push 	WP1_hWnd			;WP1_hWnd, handle of window
call 	ShowWindow			;- API Function -
;------------------------------------------------------------------------------
; API "Shell_NotifyIconA" here sends a msg. to the system to add a taskbar icon 
;------------------------------------------------------------------------------
push	OFFSET nid_cbSize		;pnid, address of NOTIFYCONDATA struc.
push	0h				;dwMessage, NIM_ADD=0h
call	Shell_NotifyIconA		;- API Function -
jmp	WP1_return			;

;==============================================================================
; WM_PAINT (value=0Fh) message, used to repaint the window area
;------------------------------------------------------------------------------
WP1_uMsg_0Fh:
cmp	eax,0Fh				;check if WM_PAINT message recieved
jne	WP1_uMsg_111h			;if not goto label
jmp	WP1_return			;

;==============================================================================
; WM_COMMAND (value=111h) message recieved ?
;------------------------------------------------------------------------------
WP1_uMsg_111h:
cmp	eax,111h			;check if WM_COMMAND message recieved
jne	WP1_uMsg_500h			;if not goto label

;==============================================================================
; On WM_COMMAND message we check if it is posted by a menu control ( lParam=0 )
; or by a child window control ( lParam not 0 )!
;------------------------------------------------------------------------------
;                 Low word of wParam    High word wParam    lParam
; Menu          - Menu ID               0                   0
; Child window  - Control ID            Notification code   Child Window Handle
;------------------------------------------------------------------------------
mov	eax,WP1_lParam			;check if menu control ( lParam=0 )
jne	WP1_lParam_0100h		;if not 0 goto label

;==============================================================================
; Check extra message info menu control, check if popup menu item clicked
;------------------------------------------------------------------------------
WP1_wParam_01h:
mov	eax,WP1_wParam			;extra info about the message in ax
cmp	ax,01h				;is it popup menu item 01h = Restore
jne	WP1_wParam_02h			;if not 01h goto LABEL
;------------------------------------------------------------------------------
; API "Shell_NotifyIconA" here deletes the icon from the taskbar 
;------------------------------------------------------------------------------
push	OFFSET nid_cbSize		;pnid, pointer NOTIFYICONDATA structure
push	2h				;dwMessage, ID msg. send, 2h=NIM_DELETE 
call	Shell_NotifyIconA		;- API Function -
;------------------------------------------------------------------------------
; API "ShowWindow" function sets the specified window's show state. 
;------------------------------------------------------------------------------
push 	9h				;nCmdShow, show state 9=SW_RESTORE
push 	hWnd				;hwnd, handle of window
call 	ShowWindow			;- API Function -
jmp	WP1_return			;

WP1_wParam_02h:				;LABEL
cmp	ax,02h				;is it popup menu item 02h = About
jne	WP1_wParam_03h			;if not 02h goto LABEL
;------------------------------------------------------------------------------
; API "MessageBoxA" creates a message box, we can only click OK
;------------------------------------------------------------------------------
push	0h             			;uType, style, 0=MB_OK Button
push	OFFSET MB1Titel			;lpCaption,pointer to title text
push	OFFSET MB1Text             	;lpText,pointer to text message box
push	WP1_hWnd			;handle of owner window 0=no owner
call	MessageBoxA       		;- API Function -
jmp	WP1_return			;

WP1_wParam_03h:				;LABEL
cmp	ax,03h				;is it popup menu item 03h = Exit
jne	WP1_return			;
;------------------------------------------------------------------------------
; API "Shell_NotifyIconA" here deletes the icon from the taskbar 
;------------------------------------------------------------------------------
push	OFFSET nid_cbSize		;pnid, pointer NOTIFYICONDATA structure
push	2h				;dwMessage, ID msg. send, 2h=NIM_DELETE 
call	Shell_NotifyIconA		;- API Function -
;------------------------------------------------------------------------------
; API "DestroyWindow" destroys the main program
;------------------------------------------------------------------------------
push	WP1_hWnd			;hMenu, handle of main window
call	DestroyWindow			;- API Function -
jmp	WP1_return			;

;==============================================================================
; uMsg value=500h recieved ? We define this value above in WM_SIZE !!!
;------------------------------------------------------------------------------
WP1_uMsg_500h:
cmp	eax,500h			;check if WM_COMMAND message recieved
jne	WP1_return			;if not goto label
mov	eax,WP1_wParam			;
cmp	ax,0h				;our tray icon's ID
jne	WP1_return			;
cmp	WP1_lParam,204h			;mouse message, WM_RBUTTONDOWN = 204h
jne	Left_button			;goto LABEL
push	OFFSET point_xpt		;pointer to POINT structure
call	GetCursorPos			;- API Function -
push	WP1_hWnd			;
call	SetForegroundWindow		;- API Function -
push	0h				;lptpm,Pointer TPMPARAMS structure,0=no 
push	WP1_hWnd			;hWnd, handle of owner window
push	point_ypt			;y, vertical position
push	point_xpt			;x, horizontal position
push	0Ah				;fuFlags,TPM_RIGHTALIGN,TPM_RIGHTBUTTON
push	hpopup				;handle of popup menu
call	TrackPopupMenuEx		;- API Function -
push	0h				;lParam, second message parameter
push	0h				;wParam, first message parameter
push	0h				;uMsg, message to post, 0h=WM_Null
push	WP1_hWnd			;hwnd, handle of destination window
call	PostMessageA			;- API Function - prevents error
jmp	WP1_return			;

Left_button:				;LABEL
cmp	WP1_lParam,203h			;mouse message, WM_LBUTTONDBLCLK = 203h
jne	WP1_return			;
push	0h				;lParam, second message parameter
push	01h				;wParam, message parameter, 01h=Restore
push	111h				;uMsg, message to send, 111h=WM_COMMAND
push	WP1_hWnd			;hwnd, handle of destination window
call	SendMessageA			;- API Function -
jmp	WP1_return			;

;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
; Here we react to any action related to the child windows ( lParam not 0 ).
;==============================================================================
; DUMMY not used here !
;------------------------------------------------------------------------------
WP1_lParam_0100h:
jmp	WP1_return			; DUMMY
;==============================================================================
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

;==============================================================================
; API "DefWindowProcA" calls the window procedure to provide default processing
; for any window messages that an application does not process.
; This function ensures that every message is processed.
; It is called with the same parameters received by the window procedure.
;------------------------------------------------------------------------------
WP1_return:
popad					;pop all register from stack
push	WP1_lParam			;extra info about the message
push	WP1_wParam			;extra info about the message
push	WP1_uMsg			;the message number
push	WP1_hWnd			;handle of window who receives message
call	DefWindowProcA			;- API Function -
ret					;return to lpfnWndProc (multitask os)
;==============================================================================
;##############################################################################

;==============================================================================
; end Main	= end of our program code
;------------------------------------------------------------------------------
end Main				;end of our program code, entry point

;==============================================================================
; To create the exe file use this commands with your Microsoft Assembler/Linker
;------------------------------------------------------------------------------
; ml.exe /c /coff td__040.asm					;asm command
; rc.exe /v rsrc.rc						;rc command
; cvtres.exe /machine:ix86 rsrc.res
; link.exe /subsystem:windows td__040.obj rsrc.obj		;link command
;==============================================================================