First of all, please do a small experiment (please save the results of the program you are executing in advance):
Click on "Start-Program-ms-dos mode", enter the DOS window, and then type "Rundll32.exe user.exe,restartwindows", then press ENTER, then you will see that the machine has been restarted!
Of course, Rundll's function is more than just rebooting your machine. In fact, Rundll, as the name implies, the implementation of the DLL, it is the function of the command column to call the dynamic chain of Windows database, The difference between Rundll32.exe and Rundll.exe is that the former is called a 32-bit chain, and the latter is a 16-bit chain-node library, and their command format is:
Rundll. Exe
Here are three points to note:
1.DLL file name can not contain spaces, such as the file is located in the C:Program files directory, you have to change this path to c:progra~1;
2.DLL file name and DLL entry point between the comma can not be less, otherwise the program will be wrong and will not give any information!
3. This is the most important point: Rundll cannot be used to call DLLs with return value parameters, such as GetUserName (), Gettextface (), and so on in Win32API.
In Visual Basic, a directive shell that executes an external program is provided, in the form of:
Shell "command column"
If you can match Rundll32.exe with a good shell command, makes your VB program have an effect that is difficult or impossible to implement in other ways: Still, for example, the traditional method requires you to create a module in the VB project, and then write the WINAPI declaration before you can call in the program. And now just one sentence:
Shell "Rundll32.exe user.exe,restartwindows" is done!
In fact, Rundll32.exe has a unique advantage in calling various Windows Control panels and system options.
Features: Displays the Control Panel-multimedia Properties-CD Music property page.
Command column: rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4
Features: Displays the Control Panel-Multimedia Properties-Devices property page.
Of course, more than just VisualBasic, such as delphi.visualc++ and other programming languages can call the external command method to use the rundll of these functions, the specific method here is no longer described in detail. Flexible use of rundll, will make your program design lightly loose, to achieve a multiplier effect!
< shutdown shortcuts >
(1). Press the right mouse button on the desktop space-> < new >-> < shortcuts >
(2). In < command line > type Rundll.exe user.exe,exitwindows
(3). In < Select the name of the shortcut > type < close window> or you want the name-> Press < to complete the >
< restart shortcuts >
(1). Repeat above (1)
(2). In < command line > type Rundll.exe user.exe,restartwindowsexec
(3). In < Select the name of the shortcut > type < restart restart> or you want the name-> Press < to complete the > RUN-> cmd or command
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.