Open API function secrets-General dialog box

Source: Internet
Author: User
Comdlg32.dll provides some useful dialogs, but some system dialogs that we may use are not provided. It would be a hassle to try to copy these system dialogs. Fortunately, shell32.dll provides these dialogs. This article will show you some undisclosed API functions to implement these dialogs.

Before using undisclosed API functions, you must know that declaring undisclosed API functions is slightly different from declaring public API functions, that is, you must use ordinal number ). This sequence number is the alias of an undisclosed function. That is to say, when declaring an API function that has not been made public, you must add its alias. For example, the sequence number of the pickicondlg function to be mentioned below is 62, and its alias is "#62 ". If you do not do this, the system will prompt that you cannot find the function entry point.

Select icon

Bool winapi pickicondlg (
Hwnd hwndowner,
Lpstr lpstrfile,
DWORD nmaxfile,
Lpdword lpdwiconindex );

The sequence number of this function is 62.

Hwndowner has the window handle lpstrfile of the dialog box pointing to a buffer that contains the initial file name. After the function returns, it contains the new file name. Nmaxfile specifies the buffer size, in characters. Lpdwiconindex points to a variable that contains a zero-based icon index. After the function returns, it contains the index value of the new graph. If you select an icon, the returned value is true. If you select the cancel button or the disable option of the System menu, the returned value is false.

Run program dialog box

Void winapi runfiledlg (
Hwnd hwndowner,
Hicon,
Lpcstr lpstrdirectory,
Lpcstr lpstrtitle,
Lpstr lpstrdescription,
Uint uflags );

The sequence number of this function is 61. You can declare the following in VB:

Private declare function runfiledlg lib "shell32" alias "#61" (byval hwndowner as long, byval hicon as long, byval lpstrdirectory as string, byval lpstrtitle as string, byval lpstrdescription as string, byval uflags as long) as long

The optional value of the uflags parameter is

Rff_nobrowse 0x01 removes the Browse button.
Rff_nodefault 0x02 no default item selected.
Rff_calcdirectory 0x04 calculates the working directory from the file name.
Rff_nolabel 0x08 removes the edit box label.
Rff_noseparatemem 0x20 removes the separate memory space check box (Windows NT only ).

 

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.