Call Exported DLL Function
Posted: 25 Apr 2009 01:39
Hi all,
I have created handy and portable command line utility that is
able to call dllexported functions:
http://www.2shared.com/file/5485995/4b969d2c/_call.html
Few examples how to use it:
Display message box with yes and no buttons
Get input typing time
Change your wallpaper...
And string length:
have fun
I have created handy and portable command line utility that is
able to call dllexported functions:
http://www.2shared.com/file/5485995/4b969d2c/_call.html
Few examples how to use it:
Display message box with yes and no buttons
Code: Select all
@echo off
_call user32.dll MessageBoxA -d 0 -s "Yes or No?" -s "Question" -d 36
rem 36 = MB_ICONQUESTION+MB_YESNO
if %errorlevel% == 6 (goto :yes) else (goto :no)
:yes
echo Yes!
pause > nul
exit
:no
echo No!
pause > nul
exit
Get input typing time
Code: Select all
@echo off
echo Type your name:
_call kernel32.dll GetTickCount
set /a start=%errorlevel%
set /p name=Name :
_call kernel32.dll GetTickCount
set /a end=%errorlevel%
set /a diff=%end%-%start%
echo Hi, %name%. It took you %diff% ms to type your name.
pause > nul
exit
Change your wallpaper...
Code: Select all
@echo off
echo Type your wallpaper file. This must be bitmap (bmp)
set /p img=Bitmap path (bmp) :
_call user32.dll SystemParametersInfoA -d 20 -d 0 -s "%img%" -d 3
echo Wallpaper should be changed now. Press any key.
pause > nul
exit
And string length:
Code: Select all
@echo off
set /p str=Type something :
_call msvcrt.dll strlen -s "%str%"
echo String length: %errorlevel% chars
have fun