.386
.model flat,stdcall
option casemap:none
; #########################################################################
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
; #########################################################################
; #########################################################################
.data
MsgBoxCaption db "LED BLinker Ver.1",0
Msg1 db " ------ Wellcome To LED Blinker ------ ",0
Msg2 db "This programm Created By Mahdei Farhani & Hamir Reza firoozy !!!",0
Msg3 db "This Aplaction Created By Masm32 Ver 8.2 ....",0
ClassName db "LEDBlinker",0
AppName db "LED Blinker",0
TimerID dd 0
;Libname db "Inpout32.dll",0
Libname db "KERNEL32.DLL",0 ; see my note:
;###---Note1:---###
; I changed it b'c i didn't have Inpout32.dll to Kernell32.dll
; so i can call Beep Function
; beep (dwFreq , dwDuration )
; ok.now u can change it to what ever u want.
;###---Note2:---###
; in assembly thease word not same "Kernel32.dll" and "KERNEL32.DLL"
;###-----------###
FunctionName db "Beep",0 ; see my note
;FunctionName db "Out32",0
DllNotFound db "Can not Load Library Kernel32.dll",0
FunctionNotFound db "Error In Opening Function OUT",0
FunctionRetError db "Error In Calling Function",0
.DATA? ; Uninitialized data
hInstance HINSTANCE ? ; Instance handle of our program
CommandLine LPSTR ?
hLib dd ?
OutAddr dd ?
.code
start:
;////////////////////////////////////////////////////////////////////////;
; Show The Message Box In Load programm ;
;////////////////////////////////////////////////////////////////////////;
; invoke MessageBox, NULL, addr Msg1, addr MsgBoxCaption, MB_OK
; invoke MessageBox, NULL, addr Msg2, addr MsgBoxCaption, MB_OK + MB_ICONINFORMATION
;invoke MessageBox, NULL, addr Msg3, addr MsgBoxCaption, MB_OK + MB_ICONINFORMATION
invoke LoadLibrary,addr Libname
.if eax==NULL
invoke MessageBox,NULL,addr FunctionNotFound,addr AppName,MB_OK + MB_ICONSTOP
.else
mov hLib,eax
invoke GetProcAddress,hLib,addr FunctionName
.if eax==NULL
invoke MessageBox,NULL,addr FunctionNotFound,addr AppName,MB_OK + MB_ICONSTOP
jmp endit ; if null go to endit
.endif
mov OutAddr,eax
push 64 ; this is dwDuration paramter.U push first last par and last-1 to firat one
; in reverse order . may be u don't pay atention to this note
push 457 ; this is dwFreq parameter in reverse order
call OutAddr ; now ready to call someting
.if eax==NULL
invoke MessageBox,NULL,addr FunctionRetError,addr AppName,MB_OK + MB_ICONSTOP
.endif
.endif
invoke FreeLibrary,hLib
endit:
invoke ExitProcess,0
end start