1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| .data
chemin db "c:\masm32\help.txt",0
.code
invoke OuvrirLecture,addr chemin
;la figure (smiley) = :D
; #########################################################################
OuvrirLecture proc NomaOuvrir :Dword
invoke CreateFile,NomaOuvrir,\
GENERIC_READ,NULL,\
NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0
.if eax==INVALID_HANDLE_VALUE
InsTxt Titrouv,"erreur ouverture fichier ",0
invoke MessageBox,hWnd,ADDR Titrouv,\
addr PageFichier,MB_OK
mov eax,0
ret
.endif
ret
OuvrirLecture endp
; ######################################################################### |
Partager