Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
Posts: 864
Threads: 13
Joined: Oct 2003
You did something wrong
try using MessageBoxA
igitalblackie.com - Done!
Ask about our hosting
-Goddess of the of the No More Religion Threads movement
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 137
Threads: 9
Joined: Feb 2004
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
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
Posts: 3,522
Threads: 189
Joined: Dec 2003
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.
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
Posts: 1,407
Threads: 117
Joined: Dec 2002
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
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.