9.06 beta

This commit is contained in:
Igor Pavlov
2009-08-17 00:00:00 +00:00
committed by Kornel Lesiński
parent 829409452d
commit c99f3ebdd6
445 changed files with 15246 additions and 8133 deletions

View File

@@ -2,12 +2,13 @@
#include "StdAfx.h"
#include "Common/MyCom.h"
#ifndef _UNICODE
#include "Common/StringConvert.h"
#endif
#include "Common/MyCom.h"
#include "Windows/Shell.h"
#include "Windows/COM.h"
#include "Windows/Shell.h"
#ifndef _UNICODE
extern bool g_IsNT;
@@ -16,8 +17,9 @@ extern bool g_IsNT;
namespace NWindows {
namespace NShell {
/////////////////////////
// CItemIDList
#ifndef UNDER_CE
// SHGetMalloc is unsupported in Windows Mobile?
void CItemIDList::Free()
{
@@ -62,6 +64,7 @@ CItemIDList& CItemIDList::operator=(const CItemIDList &object)
return *this;
}
*/
/////////////////////////////
// CDrop
@@ -79,11 +82,6 @@ void CDrop::Free()
m_Assigned = false;
}
CDrop::~CDrop()
{
Free();
}
UINT CDrop::QueryCountOfFiles()
{
return QueryFile(0xFFFFFFFF, (LPTSTR)NULL, 0);
@@ -121,9 +119,6 @@ void CDrop::QueryFileNames(UStringVector &fileNames)
}
/////////////////////////////
// Functions
bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path)
{
bool result = BOOLToBool(::SHGetPathFromIDList(itemIDList, path.GetBuffer(MAX_PATH * 2)));
@@ -131,6 +126,40 @@ bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path)
return result;
}
#endif
#ifdef UNDER_CE
bool BrowseForFolder(LPBROWSEINFO, CSysString)
{
return false;
}
bool BrowseForFolder(HWND, LPCTSTR, UINT, LPCTSTR, CSysString &)
{
return false;
}
bool BrowseForFolder(HWND owner, LPCTSTR title,
LPCTSTR initialFolder, CSysString &resultPath)
{
/*
// SHBrowseForFolder doesn't work before CE 6.0 ?
if (GetProcAddress(LoadLibrary(L"ceshell.dll", L"SHBrowseForFolder") == 0)
MessageBoxW(0, L"no", L"", 0);
else
MessageBoxW(0, L"yes", L"", 0);
*/
/*
UString s = L"all files";
s += L" (*.*)";
return MyGetOpenFileName(owner, title, initialFolder, s, resultPath, true);
*/
return false;
}
#else
bool BrowseForFolder(LPBROWSEINFO browseInfo, CSysString &resultPath)
{
NWindows::NCOM::CComInitializer comInitializer;
@@ -145,6 +174,7 @@ bool BrowseForFolder(LPBROWSEINFO browseInfo, CSysString &resultPath)
int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM /* lp */, LPARAM data)
{
#ifndef UNDER_CE
switch(uMsg)
{
case BFFM_INITIALIZED:
@@ -166,6 +196,7 @@ int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM /* lp */, LPARAM da
default:
break;
}
#endif
return 0;
}
@@ -177,8 +208,15 @@ bool BrowseForFolder(HWND owner, LPCTSTR title, UINT ulFlags,
BROWSEINFO browseInfo;
browseInfo.hwndOwner = owner;
browseInfo.pidlRoot = NULL;
// there are Unicode/astring problems in WinCE SDK!!!
#ifdef UNDER_CE
browseInfo.pszDisplayName = (LPSTR)displayName.GetBuffer(MAX_PATH);
browseInfo.lpszTitle = (LPCSTR)title;
#else
browseInfo.pszDisplayName = displayName.GetBuffer(MAX_PATH);
browseInfo.lpszTitle = title;
#endif
browseInfo.ulFlags = ulFlags;
browseInfo.lpfn = (initialFolder != NULL) ? BrowseCallbackProc : NULL;
browseInfo.lParam = (LPARAM)initialFolder;
@@ -189,7 +227,10 @@ bool BrowseForFolder(HWND owner, LPCTSTR title,
LPCTSTR initialFolder, CSysString &resultPath)
{
return BrowseForFolder(owner, title,
BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT, initialFolder, resultPath);
#ifndef UNDER_CE
BIF_NEWDIALOGSTYLE |
#endif
BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT, initialFolder, resultPath);
// BIF_STATUSTEXT; BIF_USENEWUI (Version 5.0)
}
@@ -289,4 +330,6 @@ bool BrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR initialFolder, UString &
#endif
#endif
}}