Mercurial > dwindows
diff win/XBrowseForFolder.cpp @ 1617:f8d1da63fb77
Add code to allow building DW.DLL as Unicode on Windows.
DWCOMPAT.DLL currently is still built ANSI for now.
Will add -DUNICODE and -D_UNICODE to the flags when it is stable.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 27 Mar 2012 08:51:14 +0000 |
parents | 412af8059331 |
children | d39f4f9bed26 |
line wrap: on
line diff
--- a/win/XBrowseForFolder.cpp Mon Mar 26 23:17:46 2012 +0000 +++ b/win/XBrowseForFolder.cpp Tue Mar 27 08:51:14 2012 +0000 @@ -33,12 +33,12 @@ #define _WIN32_IE 0x0500 #ifndef __AFX_H__ -#include "windows.h" -#include "tchar.h" +#include <windows.h> +#include <tchar.h> #endif -#include "Shlobj.h" -#include "io.h" +#include <Shlobj.h> +#include <io.h> #include "XBrowseForFolder.h" #ifndef __MINGW32__ @@ -108,13 +108,13 @@ static void SizeBrowseDialog(HWND hWnd, FOLDER_PROPS *fp) { // find the folder tree and make dialog larger - HWND hwndTree = FindWindowEx(hWnd, NULL, _T("SysTreeView32"), NULL); + HWND hwndTree = FindWindowEx(hWnd, NULL, TEXT("SysTreeView32"), NULL); if (!hwndTree) { // ... this usually means that BIF_NEWDIALOGSTYLE is enabled. // Then the class name is as used in the code below. - hwndTree = FindWindowEx(hWnd, NULL, _T("SHBrowseForFolder ShellNameSpace Control"), NULL); + hwndTree = FindWindowEx(hWnd, NULL, TEXT("SHBrowseForFolder ShellNameSpace Control"), NULL); } CRect rectDlg; @@ -123,7 +123,7 @@ { // check if edit box int nEditHeight = 0; - HWND hwndEdit = FindWindowEx(hWnd, NULL, _T("Edit"), NULL); + HWND hwndEdit = FindWindowEx(hWnd, NULL, TEXT("Edit"), NULL); CRect rectEdit; if (hwndEdit && (fp->ulFlags & BIF_EDITBOX)) { @@ -235,13 +235,13 @@ FOLDER_PROPS *fp = (FOLDER_PROPS *) lpData; if (fp) { - if (fp->lpszInitialFolder && (fp->lpszInitialFolder[0] != _T('\0'))) + if (fp->lpszInitialFolder && fp->lpszInitialFolder[0]) { // set initial directory ::SendMessage(hWnd, BFFM_SETSELECTION, TRUE, (LPARAM)fp->lpszInitialFolder); } - if (fp->lpszTitle && (fp->lpszTitle[0] != _T('\0'))) + if (fp->lpszTitle && fp->lpszTitle[0]) { // set window caption ::SetWindowText(hWnd, fp->lpszTitle); @@ -337,7 +337,7 @@ bi.pidlRoot = pidlRoot; } - TCHAR szInitialPath[MAX_PATH*2] = { _T('\0') }; + TCHAR szInitialPath[MAX_PATH*2] = { 0 }; if (lpszInitialFolder) { // is this a folder path string or a csidl? @@ -355,7 +355,7 @@ } } - if ((szInitialPath[0] == _T('\0')) && (bi.pidlRoot == NULL)) + if (!szInitialPath[0] && !bi.pidlRoot) { // no initial folder and no root, set to current directory ::GetCurrentDirectory(sizeof(szInitialPath)/sizeof(TCHAR)-2, @@ -383,7 +383,7 @@ if (pidlFolder) { - TCHAR szBuffer[MAX_PATH*2] = { _T('\0') }; + TCHAR szBuffer[MAX_PATH*2] = { 0 }; if (SHGetPathFromIDList(pidlFolder, szBuffer)) {