Vous êtes sur la page 1sur 11

td_win32asm_060.

asm
;==============================================================================
;
Test Department's WINDOWS 32 BIT x86 ASSEMBLY EXAMPLE's
060
;==============================================================================
;==============================================================================
; ==> Part 060 :
;-----------------------------------------------------------------------------; Bonjour,
; nothing special today, only an example of a menu bar using bitmaps.
; We create the complete menu bar at runtime and NOT in the resource file.
; In the window procedure reacting to a WM_CREATE message we call several API's
; to create the popup menu and associate some bitmaps (12x12 pixel-16 colors).
; For me it is not perfect because, for example, the bitmap colors are changing
; if we highlight the popup item.
; It seems that the only way to prevent this is to create an MF_OWNERDRAW menu,
; which is a litle bit more complicate; but currently I am not sure ...
; Interested ? Search in WIN32.HLP for "Example of Owner-Drawn Menu Items".
;
; salut
Test Department
;==============================================================================
; Assembler directives
;-----------------------------------------------------------------------------.386
; specifies the processor our program want run on
.Model Flat ,StdCall
; Flat for Win9x (32 Bit), Calling Convention
option casemap:none
; case sensitive !
;==============================================================================
; Include all files where API functins resist you want use, set correct path
;-----------------------------------------------------------------------------include D:\Masm32\include\windows.inc
includelib kernel32.lib
includelib user32.lib
includelib gdi32.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
GetMessageA
PROTO :DWORD,:DWORD,:DWORD,:DWORD
TranslateMessage
PROTO :DWORD
DispatchMessageA
PROTO :DWORD
PostQuitMessage
PROTO :DWORD
DefWindowProcA
PROTO :DWORD,:DWORD,:DWORD,:DWORD
ExitProcess
PROTO :DWORD
Page 1

td_win32asm_060.asm
CreateMenu
CreatePopupMenu
SetMenu
DrawMenuBar
SetMenuItemBitmaps
AppendMenuA
GetMenuState
CheckMenuItem
LoadBitmapA
DeleteObject
DestroyWindow
MessageBoxA

PROTO
PROTO
PROTO
PROTO
PROTO
PROTO
PROTO
PROTO
PROTO
PROTO
PROTO
PROTO

:DWORD,:DWORD
:DWORD
:DWORD,:DWORD,:DWORD,:DWORD,:DWORD
:DWORD,:DWORD,:DWORD,:DWORD
:DWORD,:DWORD,:DWORD
:DWORD,:DWORD,:DWORD
:DWORD,:DWORD
:DWORD
:DWORD
:DWORD,:DWORD,:DWORD,:DWORD

;==============================================================================
; .const
= the constants area starts here,constants are defined and fixed
;-----------------------------------------------------------------------------.const
; - Parameter MAIN WINDOW CallBack Procedure ( API=RegisterClassExA ) WP1_CallBack
equ [ebp+4]
;return address
WP1_hWnd
equ [ebp+8]
;handle of window who receives message
WP1_uMsg
equ [ebp+12]
;the message number
WP1_wParam
equ [ebp+16]
;extra info about the message
WP1_lParam
equ [ebp+20]
;extra info about the message
;==============================================================================
; .Data
= the data area starts here, datas are defined but not fixed
;-----------------------------------------------------------------------------.Data
IconName
db "TDIcon",0
;icon name in rc file
Class
db "TDWinClass",0
;name of window class
WindowName
db "Test Department - http://surf.to/TestD",0;
MB1_Titel
db "Info",0
;
MB1_Text
db "Popup Item clicked",0;
PopupMenuString
db "&Popup",0
;
PopupItemString1
db "Popup Item &1",0
;
PopupItemString2
db "Popup Item &2",0
;
PopupItemString3
db "Popup Item &3",0
;
PopupItemString4
db "Popup Item &4",0
;
;==============================================================================
; .Data?
= the data? area starts here, not defined and not fixed
;-----------------------------------------------------------------------------.data?
handleMenu
dd ?
;handle of created menu
handlePopup
dd ?
;handle of created popup menu
handleBitmap1
dd ?
;handle bitmap
handleBitmap1c
dd ?
;handle bitmap
handleBitmap2
dd ?
;handle bitmap
handleBitmap2c
dd ?
;handle bitmap
handleBitmap3
dd ?
;handle bitmap
handleBitmap4
dd ?
;handle bitmap
align 4
Page 2

td_win32asm_060.asm
; - WndClassEx Structure ( API=RegisterClassExA ) cbSize
dd ?
;size in bytes of this structure
style
dd ?
;window style
lpfnWndProc
dd ?
;address of user proc function
cbclsExtra
dd ?
;extra bytes to allocate set to 0
cbWndExtra
dd ?
;extra bytes class directive, rc file
hInstance
dd ?
;program handle(API=GetModuleHandleA)
hIcon
dd ?
;handle of icon (API=LoadIconA)
hcursor
dd ?
;handle of cursor (API=LoadCursor)
hbrBackground
dd ?
;background color, 0=transparent
lpszMenuName
dd ?
;name of menu class in resource file
lpszClassName
dd ?
;name of windows this window class
hIconSm
dd ?
;iconhandle 0=search in resource file
hdcDest
dd ?
;handle of dest. device context
align 4
; - Msg Structure ( API=GetMessageA ) - member POINT = POINT structure
hWnd
dd ?
;handle of window who receives message
message
dd ?
;the message number
wParam
dd ?
;extra info about the message
lParam
dd ?
;extra info about the message
time
dd ?
;time the message was posted
xpt
dd ?
;cursor x-position, POINT struc
ypt
dd ?
;cursor x-position, POINT struc
;==============================================================================
; .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 Class ;name of windows class
mov
hIconSm,0h
;iconhandle 0=search in rc file
;-----------------------------------------------------------------------------; API "LoadIconA" loads an icon defined in the resource file and stores the
Page 3

td_win32asm_060.asm
; 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
;store 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
;store 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
000000A0h
;intnHeight, window height pixel
push
00000140h
;intnWidth, window width pixel
push
00000090h
;inty, vertical position window
push
000000C0h
;intx, horizontal position window
push
04CA0000h
;dwStyle, look into WIN32.HLP
push
OFFSET WindowName
;lpWindowName, pointer to window name
push
OFFSET Class
;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
Page 4

td_win32asm_060.asm
call

UpdateWindow

;- API Function -

LoopGetMessage:
;==============================================================================
; API "GetMessageA" retrieves a message + places it in the specified structure.
;-----------------------------------------------------------------------------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 virtual-key messages in 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
ExitPrg:
;==============================================================================
; Next we terminate our program (API=ExitProcess)
;-----------------------------------------------------------------------------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.
; 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:
push
ebp
;create stack frame
mov
ebp,esp
;
pushad
;push all register to the stack
mov
eax,WP1_uMsg
;move the message number to eax
;==============================================================================
; WM_CREATE (value=01h) message received ?
;-----------------------------------------------------------------------------Page 5

td_win32asm_060.asm
WP1_uMsg_01h:
cmp
eax,1h
;check if WM_CREATE message recieved
jne
WP1_uMsg_02h
;if not goto LABEL
;-----------------------------------------------------------------------------; API "LoadBitmapA" loads a bitmap from the resource file
;-----------------------------------------------------------------------------push
80h
;lpBitmapName, bitmap resource ID
push
hInstance
;hInstance, handle of modul instance
call
LoadBitmapA
;- API Function mov
handleBitmap1,eax
;hObject, handle of graphic object
push
81h
;lpBitmapName, bitmap resource ID
push
hInstance
;hInstance, handle of modul instance
call
LoadBitmapA
;- API Function mov
handleBitmap2,eax
;hObject, handle of graphic object
push
82h
;lpBitmapName, bitmap resource ID
push
hInstance
;hInstance, handle of modul instance
call
LoadBitmapA
;- API Function mov
handleBitmap3,eax
;hObject, handle of graphic object
push
83h
;lpBitmapName, bitmap resource ID
push
hInstance
;hInstance, handle of modul instance
call
LoadBitmapA
;- API Function mov
handleBitmap4,eax
;hObject, handle of graphic object
push
84h
;lpBitmapName, bitmap resource ID
push
hInstance
;hInstance, handle of modul instance
call
LoadBitmapA
;- API Function mov
handleBitmap1c,eax
;hObject, handle of graphic object
push
85h
;lpBitmapName, bitmap resource ID
push
hInstance
;hInstance, handle of modul instance
call
LoadBitmapA
;- API Function mov
handleBitmap2c,eax
;hObject, handle of graphic object
;-----------------------------------------------------------------------------; API "CreateMenu" creates a menu. The menu is initially empty, but it can be
; filled with menu items by using the AppendMenu and InsertMenu functions.
;-----------------------------------------------------------------------------call
CreateMenu
;- API Function mov
handleMenu,eax
;
;-----------------------------------------------------------------------------; API "CreatePopupMenu" creates a pop-up menu. It is initially empty, but it
; can be filled with menu items by using AppendMenu and InsertMenu functions.
;-----------------------------------------------------------------------------call
CreatePopupMenu
;- API Function mov
handlePopup,eax
;
;-----------------------------------------------------------------------------; API "AppendMenuA" appends a new item to the end of the specified menu.
; An application can use this function to specify the content, appearance and
; behavior of the menu item.
;-----------------------------------------------------------------------------push
OFFSET PopupMenuString
;lpNewItem, menu item content, handle
push
handlePopup
;uIDNewItem, menu item id or popup handle
push
10h
;uFlags, menu item flags
;MF_POPUP
= 10h
;MF_STRING = 0h
push
handleMenu
;hMenu, handle of menu
Page 6

td_win32asm_060.asm
call
AppendMenuA
;- API Function ;-----------------------------------------------------------------------------; API "AppendMenuA" appends a new item to the end of the specified menu.
; An application can use this function to specify the content, appearance and
; behavior of the menu item.
;-----------------------------------------------------------------------------push
OFFSET PopupItemString1
;lpNewItem, menu item content
push
1h
;uIDNewItem, menu item id or popup handle
push
0h
;uFlags, menu item flags, MF_STRING = 0h
push
handlePopup
;hMenu, handle of popup menu
call
AppendMenuA
;- API Function push
OFFSET PopupItemString2
;lpNewItem, menu item content
push
2h
;uIDNewItem, menu item id or popup handle
push
0h
;uFlags, menu item flags, MF_STRING = 0h
push
handlePopup
;hMenu, handle of popup menu
call
AppendMenuA
;- API Function push
0h
;lpNewItem, here ignored
push
0h
;uIDNewItem, here ignored
push
800h
;uFlags, menu item flags MF_SEPARATOR=800h
push
handlePopup
;hMenu, handle of popup menu
call
AppendMenuA
;- API Function push
OFFSET PopupItemString3
;lpNewItem, menu item content
push
3h
;uIDNewItem, menu item id or popup handle
push
0h
;uFlags, menu item flags, MF_STRING = 0h
push
handlePopup
;hMenu, handle of popup menu
call
AppendMenuA
;- API Function push
0h
;lpNewItem, here ignored
push
0h
;uIDNewItem, here ignored
push
800h
;uFlags, menu item flags MF_SEPARATOR=800h
push
handlePopup
;hMenu, handle of popup menu
call
AppendMenuA
;- API Function push
OFFSET PopupItemString4
;lpNewItem, menu item content
push
4h
;uIDNewItem, menu item id or popup handle
push
0h
;uFlags, menu item flags, MF_STRING = 0h
push
handlePopup
;hMenu, handle of popup menu
call
AppendMenuA
;- API Function ;-----------------------------------------------------------------------------; API "SetMenuItemBitmaps" associates the specified bitmap with a menu item.
; Whether the menu item is checked or unchecked, Windows displays the
; appropriate bitmap next to the menu item.
;-----------------------------------------------------------------------------push
handleBitmap1c
;hbmChecked, handle of checked bitmap
push
handleBitmap1
;hbmUnchecked, handle of unchecked bitmap
push
0h
;fuFlags, menuitem flags, MF_BYCOMMAND = 0h
push
1h
;uItem, popup menu item to receive new BMP
push
handleMenu
;hmenu, handle of menu
call
SetMenuItemBitmaps
;- API Function push
handleBitmap2c
;hbmChecked, handle of checked bitmap
push
handleBitmap2
;hbmUnchecked, handle of unchecked bitmap
push
0h
;fuFlags, menuitem flags, MF_BYCOMMAND = 0h
push
2h
;uItem, menu item to receive new bitmaps
push
handleMenu
;hmenu, handle of menu
call
SetMenuItemBitmaps
;- API Function Page 7

td_win32asm_060.asm
push
handleBitmap3
;hbmChecked, handle of checked bitmap
push
handleBitmap3
;hbmUnchecked, handle of unchecked bitmap
push
0h
;fuFlags, menuitem flags, MF_BYCOMMAND = 0h
push
3h
;uItem, menu item to receive new bitmaps
push
handleMenu
;hmenu, handle of menu
call
SetMenuItemBitmaps
;- API Function push
handleBitmap4
;hbmChecked, handle of checked bitmap
push
handleBitmap4
;hbmUnchecked, handle of unchecked bitmap
push
0h
;fuFlags, menuitem flags, MF_BYCOMMAND = 0h
push
4h
;uItem, menu item to receive new bitmaps
push
handleMenu
;hmenu, handle of menu
call
SetMenuItemBitmaps
;- API Function ;-----------------------------------------------------------------------------; API "SetMenu" assigns a new menu to the specified window.
;-----------------------------------------------------------------------------push
handleMenu
;hmenu, handle of menu
push
WP1_hWnd
;hwnd, handle of window
call
SetMenu
;- API Function ;-----------------------------------------------------------------------------; API "DrawMenuBar" redraws the menu bar of the specified window.
;-----------------------------------------------------------------------------push
WP1_hWnd
;hwnd, handle of window
call
DrawMenuBar
;- 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_111h
;if not 2h go to LABEL
call
My_CleanSystem
;- SubRoutine ;-----------------------------------------------------------------------------; API "PostQuitMessage" indicates to Windows a request to terminate
;-----------------------------------------------------------------------------push
0h
;nExitCode, exit code=wParam
call
PostQuitMessage
;- API Function popad
;pop all register back from stack
xor
eax,eax
;set eax to 0 to exit our program
mov
esp,ebp
;delete stack frame
pop
ebp
;
ret
10h
;return and clear stack
;==============================================================================
; WM_COMMAND (value=111h) message recieved ?
;-----------------------------------------------------------------------------WP1_uMsg_111h:
cmp
eax,111h
;check if WM_COMMAND message recieved
jne
WP1_uMsg_112h
;if not goto label
mov
eax,WP1_wParam
;extra info about the message in ax
cmp
ax,1h
;
jne
PopupItem2
;
;-----------------------------------------------------------------------------Page 8

td_win32asm_060.asm
; API "GetMenuState" retrieves the menu flags associated with the specified
; menu item. If the menu item activates a pop-up menu, this function also
; returns the number of items in the pop-up menu.
;-----------------------------------------------------------------------------push
0h
;uFlags, menu flags, MF_BYCOMMAND = 0h
push
1h
;uId,
menu item to query
push
handleMenu
;hMenu, handle of menu
call
GetMenuState
;- API Function and
eax,8h
;only interested in MF_CHECKED
xor
eax,8h
;toogle bit to switch check flag
;-----------------------------------------------------------------------------; API "CheckMenuItem" sets the state of the specified menu item's check mark
; attribute to either checked or unchecked.
;-----------------------------------------------------------------------------push
eax
;uCheck, menu item flags, MF_BYCOMMAND = 0h
push
1h
;uIDCheckItem, menu item to check / uncheck
push
handleMenu
;hmenu, handle of menu
call
CheckMenuItem
;- API Function jmp
WP1_return
;
PopupItem2:
cmp
ax,2h
;
jne
PopupItem3
;
;-----------------------------------------------------------------------------; API "GetMenuState" retrieves the menu flags associated with the specified
; menu item. If the menu item activates a pop-up menu, this function also
; returns the number of items in the pop-up menu.
;-----------------------------------------------------------------------------push
0h
;uFlags, menu flags, MF_BYCOMMAND = 0h
push
2h
;uId,
menu item to query
push
handleMenu
;hMenu, handle of menu
call
GetMenuState
;- API Function and
eax,8h
;only interested in MF_CHECKED
xor
eax,8h
;toogle bit to switch check flag
;-----------------------------------------------------------------------------; API "CheckMenuItem" sets the state of the specified menu item's check mark
; attribute to either checked or unchecked.
;-----------------------------------------------------------------------------push
eax
;uCheck, menu item flags, MF_BYCOMMAND = 0h
push
2h
;uIDCheckItem, menu item to check / uncheck
push
handleMenu
;hmenu, handle of menu
call
CheckMenuItem
;- API Function jmp
WP1_return
;
PopupItem3:
cmp
ax,3h
;
jne
PopupItem4
;
;-----------------------------------------------------------------------------; API "MessageBoxA" creates a message box, we can only click OK
;-----------------------------------------------------------------------------push
0h
;uType, style, 0=MB_OK Button
push
OFFSET MB1_Titel
;lpCaption,pointer to title text
push
OFFSET MB1_Text
;lpText,pointer to text message box
Page 9

push
call
jmp

WP1_hWnd
MessageBoxA
WP1_return

td_win32asm_060.asm
;handle of owner window 0=no owner
;- API Function ;

PopupItem4:
cmp
ax,4h
;last popup menu item exist's program
jne
WP1_return
;goto LABEL
;-----------------------------------------------------------------------------; API "DestroyWindow" function destroys the given window if we want exit prg.
;-----------------------------------------------------------------------------push
WP1_hWnd
;hwnd, handle of window to destroy
call
DestroyWindow
;- API Function jmp
WP1_return
;
;==============================================================================
; WM_SYSCOMMAND (value=112h) message recieved ?
;-----------------------------------------------------------------------------WP1_uMsg_112h:
cmp
eax,112h
;check if WM_COMMAND message recieved
jne
WP1_return
;if not goto label
mov
eax,WP1_wParam
;extra info about the message
cmp
eax,0F060h
;SC_CLOSE=0F060h received ?
jne
WP1_return
;
call
My_CleanSystem
;- SubRoutine jmp
WP1_return
;==============================================================================
; 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 mov
esp,ebp
;delete stack frame
pop
ebp
;
ret
10h
;return and clear stack
;##############################################################################
;******************************************************************************
; My own subroutine(s) for a compacter code resist here ...
;-----------------------------------------------------------------------------My_CleanSystem:
;-----------------------------------------------------------------------------; API "DeleteObject" deletes a logical pen, brush, font, bitmap, region, or
; palette, freeing all system resources associated with the object.
; After the object is deleted, the specified handle is no longer valid.
;-----------------------------------------------------------------------------Page 10

td_win32asm_060.asm
push
handleBitmap1
;hObject, handle of graphic object
call
DeleteObject
;- API Function push
handleBitmap2
;hObject, handle of graphic object
call
DeleteObject
;- API Function push
handleBitmap3
;hObject, handle of graphic object
call
DeleteObject
;- API Function push
handleBitmap4
;hObject, handle of graphic object
call
DeleteObject
;- API Function push
handleBitmap1c
;hObject, handle of graphic object
call
DeleteObject
;- API Function push
handleBitmap2c
;hObject, handle of graphic object
call
DeleteObject
;- API Function ret
;******************************************************************************
;==============================================================================
; 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_win32asm_060.asm
;asm command
; rc.exe /v rsrc.rc
;rc command
; cvtres.exe /machine:ix86 rsrc.res
; link.exe /subsystem:windows td_win32asm_060.obj rsrc.obj
;link command
;==============================================================================

Page 11

Vous aimerez peut-être aussi