The Assembly Programming Master Book

Q. Are there any methods for simplifying operations over groups of files and directories in Windows?

Yes, there is the SHFileOperation function that can copy, move, rename, or delete file objects (files and directories, including the nested ones). This function has only one parameterthe pointer to the structure that defines, which operation should be carried out, over which objects, and how. Here is the structure.

SH struct hwnd DWORD ? wFunc DWORD ? pFrom DWORD ? pTo DWORD ? fFlags DWORD ? fAnyOperationsAborted DWORD ? hNameMappings DWORD ? lpszProgressTitle DWORD ? SH ENDS

Consider the values of the fields of this structure.

In addition to this function, there is the entire group of functions whose names start with the SH prefix. Among them, the SHGetDesktopFolder function is the most useful. It displays the dialog for choosing the required desktop folder.

Категории