mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix for wrong UNICODE definition of CFSTR_FILENAME in MinGW
svn path=/trunk/; revision=6195
This commit is contained in:
parent
eb69ba9ec2
commit
6ef5b3b5fb
16 changed files with 73 additions and 42 deletions
|
@ -45,7 +45,7 @@ static BOOL (WINAPI*SetShellWindowEx)(HWND, HWND);
|
|||
|
||||
BOOL IsAnyDesktopRunning()
|
||||
{
|
||||
HINSTANCE shell32 = GetModuleHandle(_T("user32"));
|
||||
HINSTANCE shell32 = GetModuleHandle(TEXT("user32"));
|
||||
|
||||
SetShellWindow = (BOOL(WINAPI*)(HWND)) GetProcAddress(shell32, "SetShellWindow");
|
||||
SetShellWindowEx = (BOOL(WINAPI*)(HWND,HWND)) GetProcAddress(shell32, "SetShellWindowEx");
|
||||
|
@ -71,7 +71,7 @@ static void draw_desktop_background(HWND hwnd, HDC hdc)
|
|||
rect.bottom = rect.top + 40;
|
||||
|
||||
#include "../buildno.h"
|
||||
static const LPCTSTR BkgndText = _T("ReactOS ")_T(KERNEL_VERSION_STR)_T(" Explorer\nby Martin Fuchs");
|
||||
static const LPCTSTR BkgndText = TEXT("ReactOS ")TEXT(KERNEL_VERSION_STR)TEXT(" Explorer\nby Martin Fuchs");
|
||||
|
||||
BkMode bkMode(hdc, TRANSPARENT);
|
||||
|
||||
|
@ -119,14 +119,14 @@ DesktopWindow::~DesktopWindow()
|
|||
|
||||
HWND DesktopWindow::Create()
|
||||
{
|
||||
IconWindowClass wcDesktop(_T("Progman"), IDI_REACTOS, CS_DBLCLKS);
|
||||
IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS);
|
||||
wcDesktop.hbrBackground = (HBRUSH)(COLOR_BACKGROUND+1);
|
||||
|
||||
int width = GetSystemMetrics(SM_CXSCREEN);
|
||||
int height = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
HWND hwndDesktop = Window::Create(WINDOW_CREATOR(DesktopWindow),
|
||||
WS_EX_TOOLWINDOW, wcDesktop, _T("Program Manager"), WS_POPUP|WS_VISIBLE|WS_CLIPCHILDREN,
|
||||
WS_EX_TOOLWINDOW, wcDesktop, TEXT("Program Manager"), WS_POPUP|WS_VISIBLE|WS_CLIPCHILDREN,
|
||||
0, 0, width, height, 0);
|
||||
|
||||
// work around to display desktop bar in Wine
|
||||
|
|
|
@ -38,7 +38,9 @@
|
|||
|
||||
#include "explorer_intres.h"
|
||||
|
||||
#include <locale.h>
|
||||
#include <locale.h> // for setlocale()
|
||||
#include <io.h> // for dup2()
|
||||
#include <fcntl.h> // for _O_RDONLY
|
||||
|
||||
|
||||
ExplorerGlobals g_Globals;
|
||||
|
@ -52,6 +54,7 @@ ExplorerGlobals::ExplorerGlobals()
|
|||
_hMainWnd = 0;
|
||||
_prescan_nodes = false;
|
||||
_desktop_mode = false;
|
||||
_log = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,10 +165,14 @@ int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int);
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
STARTUPINFO startupinfo;
|
||||
int nShowCmd = SW_SHOWNORMAL;
|
||||
|
||||
GetStartupInfo(&startupinfo);
|
||||
|
||||
return wWinMain(GetModuleHandle(NULL), 0, GetCommandLine(), startupinfo.wShowWindow);
|
||||
if (startupinfo.dwFlags & STARTF_USESHOWWINDOW)
|
||||
nShowCmd = startupinfo.wShowWindow;
|
||||
|
||||
return wWinMain(GetModuleHandle(NULL), 0, GetCommandLine(), nShowCmd);
|
||||
}
|
||||
|
||||
#endif // __MINGW && UNICODE
|
||||
|
@ -195,9 +202,20 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
|||
startup_desktop = TRUE;
|
||||
}
|
||||
|
||||
if (!_tcsstr(lpCmdLine,TEXT("-noautostart")))
|
||||
if (_tcsstr(lpCmdLine,TEXT("-noautostart")))
|
||||
autostart = false;
|
||||
|
||||
if (_tcsstr(lpCmdLine,TEXT("-console"))) {
|
||||
AllocConsole();
|
||||
|
||||
_dup2(_open_osfhandle((long)GetStdHandle(STD_INPUT_HANDLE), _O_RDONLY), 0);
|
||||
_dup2(_open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), 0), 1);
|
||||
_dup2(_open_osfhandle((long)GetStdHandle(STD_ERROR_HANDLE), 0), 2);
|
||||
|
||||
g_Globals._log = fdopen(1, "w");
|
||||
setvbuf(g_Globals._log, 0, _IONBF, 0);
|
||||
}
|
||||
|
||||
g_Globals._hInstance = hInstance;
|
||||
|
||||
HWND hwndDesktop = 0;
|
||||
|
|
|
@ -36,8 +36,12 @@ extern struct ExplorerGlobals
|
|||
HWND _hMainWnd;
|
||||
bool _prescan_nodes;
|
||||
bool _desktop_mode;
|
||||
|
||||
FILE* _log;
|
||||
} g_Globals;
|
||||
|
||||
#define LOG(x) if (g_Globals._log) _ftprintf(g_Globals._log, TEXT("%s\n"), (LPCTSTR)(x));
|
||||
|
||||
|
||||
struct ResString : public String
|
||||
{
|
||||
|
|
|
@ -193,8 +193,8 @@ void Pane::init()
|
|||
HKEY hkeyExplorer = 0;
|
||||
DWORD len = sizeof(_clrCompressed);
|
||||
|
||||
if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hkeyExplorer) ||
|
||||
RegQueryValueEx(hkeyExplorer, _T("AltColor"), 0, NULL, (LPBYTE)&_clrCompressed, &len) || len!=sizeof(_clrCompressed))
|
||||
if (RegOpenKey(HKEY_CURRENT_USER, TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"), &hkeyExplorer) ||
|
||||
RegQueryValueEx(hkeyExplorer, TEXT("AltColor"), 0, NULL, (LPBYTE)&_clrCompressed, &len) || len!=sizeof(_clrCompressed))
|
||||
_clrCompressed = RGB(0,0,255);
|
||||
|
||||
if (hkeyExplorer)
|
||||
|
|
|
@ -35,11 +35,11 @@
|
|||
#include "shellfs.h"
|
||||
|
||||
|
||||
bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, BY_HANDLE_FILE_INFORMATION* pbhfi, bool access)
|
||||
bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA* pw32fdata, BY_HANDLE_FILE_INFORMATION* pbhfi, bool do_access)
|
||||
{
|
||||
bool bhfi_valid = false;
|
||||
|
||||
if (access && !( (attribs & SFGAO_FILESYSTEM) && SUCCEEDED(
|
||||
if (do_access && !( (attribs&SFGAO_FILESYSTEM) && SUCCEEDED(
|
||||
SHGetDataFromIDList(_folder, pidl, SHGDFIL_FINDDATA, pw32fdata, sizeof(WIN32_FIND_DATA))) )) {
|
||||
WIN32_FILE_ATTRIBUTE_DATA fad;
|
||||
IDataObject* pDataObj;
|
||||
|
@ -88,7 +88,7 @@ bool ShellDirectory::fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN
|
|||
}
|
||||
}
|
||||
|
||||
if (!(attribs & SFGAO_FILESYSTEM) || !access) // Archiv files should not be displayed as folders in explorer view.
|
||||
if (!do_access || !(attribs&SFGAO_FILESYSTEM)) // Archiv files should not be displayed as folders in explorer view.
|
||||
if (attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
|
||||
pw32fdata->dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
|
||||
|
||||
|
@ -240,15 +240,17 @@ void ShellDirectory::read_directory()
|
|||
|
||||
memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
|
||||
|
||||
SFGAOF attribs_before = ~SFGAO_READONLY&~SFGAO_VALIDATE;
|
||||
SFGAOF attribs_before = ~SFGAO_READONLY & ~SFGAO_VALIDATE;
|
||||
SFGAOF attribs = attribs_before;
|
||||
HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs);
|
||||
bool removeable = false;
|
||||
|
||||
if (SUCCEEDED(hr) && attribs!=attribs_before) {
|
||||
// avoid accessing floppy drives when browsing "My Computer"
|
||||
if (attribs & SFGAO_REMOVABLE)
|
||||
if (attribs & SFGAO_REMOVABLE) {
|
||||
attribs |= SFGAO_HASSUBFOLDER;
|
||||
else {
|
||||
removeable = true;
|
||||
} else {
|
||||
DWORD attribs2 = SFGAO_READONLY;
|
||||
|
||||
HRESULT hr = _folder->GetAttributesOf(1, (LPCITEMIDLIST*)&pidls[n], &attribs2);
|
||||
|
@ -259,7 +261,7 @@ void ShellDirectory::read_directory()
|
|||
} else
|
||||
attribs = 0;
|
||||
|
||||
bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi, !(attribs&SFGAO_REMOVABLE));
|
||||
bhfi_valid = fill_w32fdata_shell(pidls[n], attribs, &w32fd, &bhfi, !removeable);
|
||||
|
||||
Entry* entry;
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ struct ShellDirectory : public ShellEntry, public Directory
|
|||
HWND _hwnd;
|
||||
|
||||
protected:
|
||||
bool fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, BY_HANDLE_FILE_INFORMATION*, bool access=true);
|
||||
bool fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs, WIN32_FIND_DATA*, BY_HANDLE_FILE_INFORMATION*, bool do_access=true);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
//
|
||||
|
||||
|
||||
#define CLASSNAME_EXPLORERBAR _T("Shell_TrayWnd")
|
||||
#define TITLE_EXPLORERBAR _T("") // use an empty window title, so windows taskmanager does not show the window in its application list
|
||||
#define CLASSNAME_EXPLORERBAR TEXT("Shell_TrayWnd")
|
||||
#define TITLE_EXPLORERBAR TEXT("") // use an empty window title, so windows taskmanager does not show the window in its application list
|
||||
|
||||
|
||||
#define WINMSG_TASKBARCREATED _T("TaskbarCreated")
|
||||
#define WINMSG_TASKBARCREATED TEXT("TaskbarCreated")
|
||||
|
||||
|
||||
#define DESKTOPBARBAR_HEIGHT 29
|
||||
|
|
|
@ -92,7 +92,7 @@ void QuickLaunchBar::AddShortcuts()
|
|||
|
||||
SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd);
|
||||
|
||||
_stprintf(path, _T("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data);
|
||||
_stprintf(path, TEXT("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data);
|
||||
|
||||
_dir = new ShellDirectory(Desktop(), path, _hwnd);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#define IDC_FIRST_QUICK_ID 0x4000
|
||||
|
||||
|
||||
#define QUICKLAUNCH_FOLDER _T("Microsoft\\Internet Explorer\\Quick Launch")
|
||||
#define QUICKLAUNCH_FOLDER TEXT("Microsoft\\Internet Explorer\\Quick Launch")
|
||||
|
||||
|
||||
/// quick launch bar shortcut
|
||||
|
|
|
@ -803,7 +803,7 @@ void StartMenuRoot::ShowLaunchDialog(HWND hwndDesktopBar)
|
|||
static LPCSTR szTitle = "Create New Task";
|
||||
static LPCSTR szText = "Type the name of a program, folder, document, or Internet resource, and Task Manager will open it for you.";
|
||||
|
||||
static DynamicFct<RUNFILEDLG> RunFileDlg(_T("SHELL32"), 61);
|
||||
static DynamicFct<RUNFILEDLG> RunFileDlg(TEXT("SHELL32"), 61);
|
||||
|
||||
// Show "Run..." dialog
|
||||
if (RunFileDlg) {
|
||||
|
@ -823,7 +823,7 @@ void StartMenuRoot::ShowLaunchDialog(HWND hwndDesktopBar)
|
|||
|
||||
void StartMenuRoot::ShowExitWindowsDialog(HWND hwndOwner)
|
||||
{
|
||||
static DynamicFct<EXITWINDOWSDLG> ExitWindowsDlg(_T("SHELL32"), 60);
|
||||
static DynamicFct<EXITWINDOWSDLG> ExitWindowsDlg(TEXT("SHELL32"), 60);
|
||||
|
||||
if (ExitWindowsDlg)
|
||||
(*ExitWindowsDlg)(hwndOwner);
|
||||
|
@ -831,7 +831,7 @@ void StartMenuRoot::ShowExitWindowsDialog(HWND hwndOwner)
|
|||
|
||||
void StartMenuRoot::ShowRestartDialog(HWND hwndOwner, UINT flags)
|
||||
{
|
||||
static DynamicFct<RESTARTWINDOWSDLG> RestartDlg(_T("SHELL32"), 59);
|
||||
static DynamicFct<RESTARTWINDOWSDLG> RestartDlg(TEXT("SHELL32"), 59);
|
||||
|
||||
if (RestartDlg)
|
||||
(*RestartDlg)(hwndOwner, (LPWSTR)L"You selected <Log Off>.\n\n", flags); //TODO: ANSI string conversion if needed
|
||||
|
@ -839,7 +839,7 @@ void StartMenuRoot::ShowRestartDialog(HWND hwndOwner, UINT flags)
|
|||
|
||||
void StartMenuRoot::ShowSearchDialog()
|
||||
{
|
||||
static DynamicFct<SHFINDFILES> SHFindFiles(_T("SHELL32"), 90);
|
||||
static DynamicFct<SHFINDFILES> SHFindFiles(TEXT("SHELL32"), 90);
|
||||
|
||||
if (SHFindFiles)
|
||||
(*SHFindFiles)(NULL, NULL);
|
||||
|
@ -847,7 +847,7 @@ void StartMenuRoot::ShowSearchDialog()
|
|||
|
||||
void StartMenuRoot::ShowSearchComputer()
|
||||
{
|
||||
static DynamicFct<SHFINDCOMPUTER> SHFindComputer(_T("SHELL32"), 91);
|
||||
static DynamicFct<SHFINDCOMPUTER> SHFindComputer(TEXT("SHELL32"), 91);
|
||||
|
||||
if (SHFindComputer)
|
||||
(*SHFindComputer)(NULL, NULL);
|
||||
|
@ -878,7 +878,7 @@ int SettingsMenu::Command(int id, int code)
|
|||
|
||||
case IDC_CONTROL_PANEL:
|
||||
CloseStartMenu(id);
|
||||
MainFrame::Create(_T("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), FALSE);
|
||||
MainFrame::Create(TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), FALSE);
|
||||
break;
|
||||
|
||||
case IDC_ADMIN:
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
//
|
||||
|
||||
|
||||
#define CLASSNAME_STARTMENU _T("ReactosStartmenuClass")
|
||||
#define TITLE_STARTMENU _T("Start Menu")
|
||||
#define CLASSNAME_STARTMENU TEXT("ReactosStartmenuClass")
|
||||
#define TITLE_STARTMENU TEXT("Start Menu")
|
||||
|
||||
|
||||
#define STARTMENU_WIDTH_MIN 120
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
//#include "shellhook.h"
|
||||
|
||||
|
||||
#define CLASSNAME_TASKBAR _T("MSTaskSwWClass")
|
||||
#define TITLE_TASKBAR _T("Running Applications")
|
||||
#define CLASSNAME_TASKBAR TEXT("MSTaskSwWClass")
|
||||
#define TITLE_TASKBAR TEXT("Running Applications")
|
||||
|
||||
#define IDC_FIRST_APP 0x2000
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ ClockWindow::ClockWindow(HWND hwnd)
|
|||
: super(hwnd),
|
||||
_tooltip(hwnd)
|
||||
{
|
||||
*_time = _T('\0');
|
||||
*_time = TEXT('\0');
|
||||
FormatTime();
|
||||
|
||||
_tooltip.add(_hwnd, _hwnd);
|
||||
|
@ -306,9 +306,9 @@ LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
break;
|
||||
|
||||
case WM_LBUTTONDBLCLK:
|
||||
//launch_file(_hwnd, _T("timedate.cpl"), SW_SHOWNORMAL); // This would be enough, but we want the fastest solution.
|
||||
//launch_file(_hwnd, _T("rundll32.exe /d shell32.dll,Control_RunDLL timedate.cpl"), SW_SHOWNORMAL);
|
||||
RunDLL(_hwnd, _T("shell32"), "Control_RunDLL", _T("timedate.cpl"), SW_SHOWNORMAL);
|
||||
//launch_file(_hwnd, TEXT("timedate.cpl"), SW_SHOWNORMAL); // This would be enough, but we want the fastest solution.
|
||||
//launch_file(_hwnd, TEXT("rundll32.exe /d shell32.dll,Control_RunDLL timedate.cpl"), SW_SHOWNORMAL);
|
||||
RunDLL(_hwnd, TEXT("shell32"), "Control_RunDLL", TEXT("timedate.cpl"), SW_SHOWNORMAL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
//
|
||||
|
||||
|
||||
#define CLASSNAME_TRAYNOTIFY _T("TrayNotifyWnd")
|
||||
#define TITLE_TRAYNOTIFY _T("")
|
||||
#define CLASSNAME_TRAYNOTIFY TEXT("TrayNotifyWnd")
|
||||
#define TITLE_TRAYNOTIFY TEXT("")
|
||||
|
||||
#define CLASSNAME_CLOCKWINDOW _T("TrayClockWClass")
|
||||
#define CLASSNAME_CLOCKWINDOW TEXT("TrayClockWClass")
|
||||
|
||||
#define NOTIFYAREA_WIDTH 244
|
||||
#define CLOCKWINDOW_WIDTH 32
|
||||
|
|
|
@ -268,7 +268,7 @@ String ShellFolder::get_name(LPCITEMIDLIST pidl, SHGDNF flags) const
|
|||
strret.GetString(pidl->mkid, buffer, MAX_PATH);
|
||||
else {
|
||||
CheckError(hr);
|
||||
*buffer = _T('\0');
|
||||
*buffer = TEXT('\0');
|
||||
}
|
||||
|
||||
return buffer;
|
||||
|
@ -337,7 +337,7 @@ ShellPath ShellPath::create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
|
|||
|
||||
ShellPath ShellPath::create_absolute_pidl(LPCITEMIDLIST parent_pidl) const
|
||||
{
|
||||
static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILCombine(_T("SHELL32"), 25);
|
||||
static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST, LPCITEMIDLIST)> ILCombine(TEXT("SHELL32"), 25);
|
||||
|
||||
if (ILCombine)
|
||||
return (*ILCombine)(parent_pidl, _p);
|
||||
|
|
|
@ -77,7 +77,7 @@ struct COMException
|
|||
LocalFree(pBuf);
|
||||
} else {
|
||||
TCHAR buffer[128];
|
||||
_stprintf(buffer, _T("unknown COM Exception: 0x%08X"), _hr);
|
||||
_stprintf(buffer, TEXT("unknown COM Exception: 0x%08X"), _hr);
|
||||
_msg = buffer;
|
||||
}
|
||||
}
|
||||
|
@ -426,6 +426,13 @@ extern HRESULT name_from_pidl(IShellFolder* folder, LPCITEMIDLIST pidl, LPTSTR b
|
|||
|
||||
#ifdef __MINGW32__ // ILGetSize() is currently missing in MinGW.
|
||||
extern "C" UINT ILGetSize(LPCITEMIDLIST pidl);
|
||||
|
||||
#ifdef UNICODE // CFSTR_FILENAME is defined wrong in MinGW.
|
||||
#define CFSTR_FILENAMEW TEXT("FileNameW")
|
||||
#undef CFSTR_FILENAME
|
||||
#define CFSTR_FILENAME CFSTR_FILENAMEW
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue