Introduction to system resource calls and shell32.dll

Source: Internet
Author: User
Shell32.dll is a Windows Shell-related application program interface that dynamically links library files, used to open web pages and files. For an intuitive application, right-click a folder and choose Properties> customize> change icon. The default file Systemroot %/system32/shell32.dll is used. Select an icon to create an icon for this folder.
It has nearly 8 Mb in XP, because there are a lot of resource files in it, as long as you open the file with the vs editor, you can see all the icons, images, dialog box, mouse and string resources. Generally, people modify these resources to change the appearance of the operating system resources. You can Google it to find a lot of tricks around this topic.
 
In addition, it also contains a variety of API functions, mainly system, resource and other interactive calls. For example, system. Windows. Forms. folderbrowserdialog calls the shgetspecialfolderlocation function of shell32.dll.
His API list is also available for reference on the Internet. For example, a Windows-Style dialog box is used by many software. The Code is as follows:

[Dllimport ("shell32.dll", entrypoint = "shellabout")] public static extern int shellabouta (INT hwnd, string szapp, string szotherstuff, int hicon); Private void button#click (Object sender, eventargs e) {shellabouta (this. handle. toint32 (), "One post per day", "Scissors published", 0 );}

The other method is called through rundll32.exe. For example, enter rundll32.exe shell32.dll and shellabouta jinjazz In the CMD command prompt.
You can also call many similar system dialogs or system commands, including logout, shutdown, restart and so on, refer to the http://blog.csdn.net/jinjazz/archive/2008/04/17/2302095.aspx (where the control_rundll function is quite cool ).

In addition, it can also be referenced as com. It is convenient to run the following code.

Shell32.ShellClass sh = new Shell32.ShellClass();         sh.Explore(@"c:/"); 

Of course, you can also take the opposite, for example, simulate the "Start Menu-Run" operation. You have seen the answers to the simulated buttons before, but you can actually use shellclass to solve the problem.

Some good references can be obtained through the network:

Http://www.codeproject.com/KB/shell/csdoesshell1.aspx

Http://www.codeproject.com/KB/shell/csdoesshell2.aspx

Http://www.codeproject.com/KB/shell/csdoesshell3.aspx

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.