Post by Dave "Crash" DummyThanks to you and Auric__. The rundll script is one I tried without
success. I even changed all the images to BMP.
(I always Google before flaunting my ignorance here.)
RUNDLL/RUNDLL32 is really not a universal DLL function caller. It has its
own function call specification. i.e.:
Argument #1:
[Integer] Window handle (the RUNDLL invisible window). This always varies
and not specifiable via RUNDLL command line.
Argument #2:
[Integer] Module handle (the RUNDLL EXE module).
This is 0x01000000 for 32-bit RUNDLL or 0x0000000100000000 for 64-bit
RUNDLL. This argument is not specifiable via RUNDLL command line.
Argument #3:
[Pointer] Parameter string to be passed to the function (taken from RUNDLL
command line; after the function name). Although this argument is
specifiable via RUNDLL command line, its type would always be a string and
the value passed to the DLL function is the pointer to the string, so it
always varies.
Argument #4:
[Integer] Window display command (e.g. normal, maximized, etc.). This value
is taken from the inherited window display command of the RUNDLL process, so
it's not specifiable via RUNDLL command line. The value is equal to the
second parameter of the VBScript Run method of WshShell object.
For example, if you have this RUNDLL command line...
RUNDLL module.dll,TheFunction abc 123
RUNDLL will call "TheFunction" like this:
TheFunction(Window, Module, Parameters, ShowCmd);
Where:
Window = (varies)
Module = (0x01000000 or 0x0000000100000000)
Parameters = Pointer to command line parameter: " abc 123"
ShowCmd = (inherited)
Also, RUNDLL doesn't translate the function parameters in any way. Take for
example, from the superuser.com question mentioned by R.Wieser. i.e.:
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True
In this case, the actual 3rd function parameter (argument #3) would be a
pointer to (no quote) " ,1 ,True" string.
RUNDLL won't translate number strings to integer, nor "true"/"false" boolean
to integer 1 or 0.
Most RUNDLL compatible DLL functions have their names appended with
"_RunDll" or "RunDll". Non-RUNDLL DLL functions may work if the function
expects no argument, or has lesser number of arguments with matching type.