Windows Shell Extension 获取是文件还是文件

LBJAMS 2013-03-11 06:44:54
右击选中文件或者文件之后可以通过Initialize ( LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hProgID )这个函数的第二个参数来获取选中的文件或文件夹的名字,但是有什么办法可以获取到选中的是文件还是文件
...全文
420 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
LBJAMS 2013-03-13
  • 打赏
  • 举报
回复
还想问个问题,QQ登录的时候会有以前登录的记录,我们选择的时候会显示QQ昵称和QQ号码,点击选中的时候在帐号区域只会显示QQ号码这是怎么显示的,组合框我已经实现,且在选择项里面加上了删除按钮(就是那个XX),大哥是否可以赐教!!
LBJAMS 2013-03-13
  • 打赏
  • 举报
回复
如果是快捷方式,它会认为不是文件也不是文件夹,范围-1,INVALID_FILE_ATTRIBUTES无效的文件,就是错误的文件。
LBJAMS 2013-03-13
  • 打赏
  • 举报
回复
引用 4 楼 zhao4zhong1 的回复:
楼主是结帖给分还是结帖给分?
唉,陷入到了Initialize ( LPCITEMIDLIST pidlFolder, LPDATAOBJECT pDataObj, HKEY hProgID )。失败呀,失败,刚刚试了一下,挺管用的。
赵4老师 2013-03-13
  • 打赏
  • 举报
回复
楼主是结帖给分还是结帖给分?
赵4老师 2013-03-13
  • 打赏
  • 举报
回复
File Functions The following functions are used with files. AreFileApisANSI CancelIo CopyFile CopyFileEx CopyProgressRoutine CreateDirectory CreateDirectoryEx CreateFile CreateIoCompletionPort DefineDosDevice DeleteFile FileIOCompletionRoutine FindClose FindCloseChangeNotification FindFirstChangeNotification FindFirstFile FindFirstFileEx FindNextChangeNotification FindNextFile FlushFileBuffers GetBinaryType GetCurrentDirectory GetDiskFreeSpace GetDiskFreeSpaceEx GetDriveType GetFileAttributes GetFileAttributesEx GetFileInformationByHandle GetFileSize GetFileType GetFullPathName GetLogicalDrives GetLogicalDriveStrings GetLongPathName GetQueuedCompletionStatus GetShortPathName GetTempFileName GetTempPath LockFile LockFileEx MoveFile MoveFileEx PostQueuedCompletionStatus QueryDosDevice ReadDirectoryChangesW ReadFile ReadFileEx ReadFileScatter ReadFileVlm RemoveDirectory SearchPath SetCurrentDirectory SetEndOfFile SetFileApisToANSI SetFileApisToOEM SetFileAttributes SetFilePointer SetVolumeLabel UnlockFile UnlockFileEx WriteFile WriteFileEx WriteFileGather WriteFileVlm
赵4老师 2013-03-13
  • 打赏
  • 举报
回复
GetFileAttributes The GetFileAttributes function returns attributes for a specified file or directory. DWORD GetFileAttributes( LPCTSTR lpFileName // pointer to the name of a file or directory ); Parameters lpFileName Pointer to a null-terminated string that specifies the name of a file or directory. Windows NT: There is a default string size limit for paths of MAX_PATH characters. This limit is related to how the GetFileAttributes function parses paths. An application can transcend this limit and send in paths longer than MAX_PATH characters by calling the wide (W) version of GetFileAttributes and prepending "\\?\" to the path. The "\\?\" tells the function to turn off path parsing; it lets paths longer than MAX_PATH be used with GetFileAttributesW. However, each component in the path cannot be more than MAX_PATH characters long. This also works with UNC names. The "\\?\" is ignored as part of the path. For example, "\\?\C:\myworld\private" is seen as "C:\myworld\private", and "\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps". Windows 95: The lpFileName string must not exceed MAX_PATH characters. Windows 95 does not support the "\\?\" prefix. Return Values If the function succeeds, the return value contains the attributes of the specified file or directory. If the function fails, the return value is 0xFFFFFFFF. To get extended error information, call GetLastError. The attributes can be one or more of the following values: Attribute Meaning FILE_ATTRIBUTE_ARCHIVE The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal. FILE_ATTRIBUTE_COMPRESSED The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories. FILE_ATTRIBUTE_DIRECTORY The handle identifies a directory. FILE_ATTRIBUTE_ENCRYPTED The file or directory is encrypted. For a file, this means that all data streams are encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories. FILE_ATTRIBUTE_HIDDEN The file or directory is hidden. It is not included in an ordinary directory listing. FILE_ATTRIBUTE_NORMAL The file or directory has no other attributes set. This attribute is valid only if used alone. FILE_ATTRIBUTE_OFFLINE The data of the file is not immediately available. Indicates that the file data has been physically moved to offline storage. FILE_ATTRIBUTE_READONLY The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it. FILE_ATTRIBUTE_REPARSE_POINT The file has an associated reparse point. FILE_ATTRIBUTE_SPARSE_FILE The file is a sparse file. FILE_ATTRIBUTE_SYSTEM The file or directory is part of, or is used exclusively by, the operating system. FILE_ATTRIBUTE_TEMPORARY The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed. Remarks Windows CE: Windows CE supports the following additional return values: FILE_ATTRIBUTE_INROM This file is an operating system file stored in ROM. These files are read-only; they cannot be modified. FILE_ATTRIBUTE_ROMMODULE This file is an operating system file stored in ROM, designed to execute in place. In other words, code from this file is executed directly from ROM, rather than being first copied to RAM. The CreateFile function cannot be used to access this file, instead the LoadLibrary and CreateProcess functions must be used. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in winbase.h. Import Library: Use kernel32.lib. Unicode: Implemented as Unicode and ANSI versions on Windows NT. See Also File I/O Overview, File Functions, DeviceIoControl, FindFirstFile, FindNextFile, SetFileAttributes
LBJAMS 2013-03-13
  • 打赏
  • 举报
回复
竟然没有人会?

64,676

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧