⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shellstring.cpp

📁 一个完整的显示Windows目录的程序
💻 CPP
字号:
// ShellString.cpp: implementation of the CShellString class.
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2000-2001 by Paolo Messina
// (http://www.geocities.com/ppescher - ppescher@yahoo.com)
//
// The contents of this file are subject to the Artistic License (the "License").
// You may not use this file except in compliance with the License. 
// You may obtain a copy of the License at:
// http://www.opensource.org/licenses/artistic-license.html
//
// If you find this code useful, credits would be nice!
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ShellString.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

void CShellString::Destroy()
{
	SMallocPtr pMalloc;
	if (m_str.uType == STRRET_WSTR && m_str.pOleStr != NULL)
	{
		pMalloc->Free(m_str.pOleStr);
		m_str.pOleStr = NULL;
	}
	ZeroMemory(&m_str, sizeof(STRRET));
}

STRRET* CShellString::GetPointer(LPCITEMIDLIST pidl, UINT uDesiredType)
{
	// reset the object
	Destroy();
	// init object
	m_pidl = pidl;
	ASSERT(m_pidl.IsValid());
	m_str.uType = uDesiredType;

	return &m_str;
}

CShellString::operator CString() const
{
	CString string;
	switch (m_str.uType)
	{
	case STRRET_WSTR:
		string = m_str.pOleStr;
		break;
	case STRRET_CSTR:
		string = m_str.cStr;
		break;
	case STRRET_OFFSET:
		string = ((LPBYTE)(LPCITEMIDLIST)m_pidl + m_str.uOffset);
	}
	return string;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -