Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running Windows DLL commands from the command line
#1
I came across something stating that you could access and call Windows kernel DLL functions from the command line, with rundll32.exe.
But how come this doesn't work?
Quote:C:\>rundll32 user32,MessageBox 0,"Wow","Wow",0
It runs, but it doesn't display a message box. Am I just insane, or am I doing something wrong?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#2
You did something wrong Tongue Wink

try using MessageBoxA Smile
igitalblackie.com - Done! Smile Ask about our hosting Wink

-Goddess of the of the No More Religion Threads movement Smile
Reply
#3
Okay, I'm assuming that MessageBoxA takes the same arguments as MessageBox.
Quote:C:\>rundll32 user32,MessageBoxA 0,"wow","wow",0

C:\>
No message box...just runs, and quits. No error, no success. Sad
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#4
A useful command, indeed, but unfortunatly it doesn't let you return anything to the command line. If you could do that... well, I think that would be pretty darn cool.

Jonathan Simpson
onathan Simpson
Reply
#5
Um - "return anything to the command line". Oh, I see - MessageBox won't run unless it has someplace to put the return value, which is what button did the user click. Right?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#6
If i do this under a DOS box in win98:
rundll32 user32,MessageBoxA Popup Test

I get a popup windows with the title 'Popup Test' saying:
MZn

Where n is a forbidden char (it shows up as a thick line, somewhat like |)

And as we all know MZ is the header for MS EXE file format.

Go figure.
Reply
#7
That's strange. On my XP box, trying what Z!re did, exactly, nothing happens.
I suppose Microsoft doesn't want it's ickle customers to hack at the API.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#8
There are a lot of other things that seem to work:
http://www.robvanderwoude.com/rundll.html
or
http://www.dx21.com/SCRIPTING/RUNDLL32/refguide.asp?P=A

Opening a message box is not in any list ...Maybe it worked in W3.1 only?
Antoni
Reply
#9
Yeah. Weird, you'd think that every function (except those that are purely for the purpose of returning something) would be able to be called.
Hmm.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)