Unapproved API function secret - common dialog

zhaozj2021-02-11  177

Unapproved API function secret - common dialog

Unapproved API function secret - common dialog

COMDLG32.DLL provides us with some useful dialogs, but there is still some system dialogs we may use. If you try to copy these system dialogs, it will be a trouble. Fortunately, shell32.dll provides us with these dialogs. This article will take you to discover some unapproved API functions to implement these dialogs.

Before using an unprecedented API function, you must know that the declared API function is slightly different from the disclosed API function, that is, you must use the order number (Ordinal Number) of the unapproved API function. This sequence number is an alias that is unapproved. That is to say, when the declaration is not public API function, it must be added to its alias. For example, the sequence number of the Pickicondlg function to be said is 62, and its alias is "# 62". If you don't do this, the system will prompt you to find the entry point of the function.

Select icon

Bool WinAPI Pickicondlg (HWND HWndowner, LPSTR LPSTRFILE, DWORD NMAXFILE, LPDWORD LPDWICONINDEX); the sequence number of this function is 62.

HWndowner has a window handle LPSTRFILE with this dialog to point to a buffer that contains the initial file name. After the function returns it, it contains the new file name. NmaxFile specifies the size of the buffer, in units of 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 icon. If the user selects the icon, the return value is true. If the user selects the cancel button or the shutdown option of the system menu, the return value is false.

Running program dialog

Void WinApi Runfiledlg (Hind Hwndowner, Hicon Hicon, LPCSTR LPSTRIRECTORY, LPCSTR LPSTRTILE, LPCSTR LPSTRDESCRIPTION, UINT UFLAGS); the order number of the function is 61. Declaration in VB is as follows:

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).

The above code from: the source code database (SourceDataBase) Current Version: 1.0.458 Author: Shawls profile: Http://Shawls.Yeah.Net E-Mail: ShawFile@163.Net QQ: 9181729

转载请注明原文地址:https://www.9cbs.com/read-4839.html

New Post(0)