[St-m-svn] SF.net SVN: st-m: [63] trunk
Brought to you by:
cnx_glenn
From: <cnx...@us...> - 2006-07-05 20:58:25
|
Revision: 63 Author: cnx_glenn Date: 2006-07-05 13:57:49 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/st-m/?rev=63&view=rev Log Message: ----------- Modified Paths: -------------- trunk/AboutDlg.cpp trunk/AddDlg.cpp trunk/BtOrderDlg.cpp trunk/BtOrderDlg.h trunk/DropDlg.cpp trunk/LeftView.cpp trunk/LogDlg.cpp trunk/Logoff.cpp trunk/MainFrm.cpp trunk/PropertiesDlg.cpp trunk/PropertiesDlg.h trunk/RenameDlg.cpp trunk/RenameDlg.h trunk/RightView.cpp trunk/RightView.h trunk/Startup Manager_DEBUG.dev trunk/boot/BtCore.cpp trunk/boot/BtCore.h trunk/boot/BtFolder.cpp trunk/boot/BtFolder.h trunk/boot/BtReg.cpp trunk/boot/BtReg.h trunk/boot/BtSection.cpp trunk/boot/BtSection.h trunk/boot/BtWinLogon.cpp trunk/boot/BtWinLogon.h trunk/boot/BtWinini.cpp trunk/boot/BtWinini.h trunk/boot/File.cpp trunk/boot/File.h trunk/boot/ShortCut.cpp trunk/boot/ShortCut.h trunk/boot/cLibraryInfo.h trunk/windows/HyperLink.cpp trunk/windows/WinCore.h trunk/windows/WinTools.cpp trunk/windows/WinTools.h Modified: trunk/AboutDlg.cpp =================================================================== --- trunk/AboutDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/AboutDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -24,7 +24,7 @@ #include <string> #include <tchar.h> -typedef std::basic_string<TCHAR> tString; +typedef std::basic_string<TCHAR> tstring; using namespace Windows; Modified: trunk/AddDlg.cpp =================================================================== --- trunk/AddDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/AddDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -61,12 +61,12 @@ INT32 length = ::GetWindowTextLength(::GetDlgItem(*this, IDC_SECTION)); TCHAR *buffer = new TCHAR[length + 1]; ::GetDlgItemText(*this, IDC_SECTION, buffer, length + 1); - tString section = buffer; + tstring section = buffer; delete[] buffer; length = ::GetWindowTextLength(::GetDlgItem(*this, IDC_PATH)); buffer = new TCHAR[length + 1]; ::GetDlgItemText(*this, IDC_PATH, buffer, length + 1); - tString path = buffer; + tstring path = buffer; delete[] buffer; if((path.length() > 0) && (section.length() > 0)) @@ -74,14 +74,14 @@ length = ::GetWindowTextLength(::GetDlgItem(*this, IDC_NAME)); buffer = new TCHAR[length + 1]; ::GetDlgItemText(*this, IDC_NAME, buffer, length + 1); - tString name = buffer; + tstring name = buffer; delete[] buffer; if(section.find(TEXT("Registry")) != string::npos) { if(!((section.find(TEXT("UserInit")) != string::npos) || (section.find(TEXT("Shell")) != string::npos))) { - tString flags = TEXT(""); + tstring flags = TEXT(""); length = ::GetWindowTextLength(::GetDlgItem(*this, IDC_FLAGS)); buffer = new TCHAR[length + 1]; ::GetDlgItemText(*this, IDC_FLAGS, buffer, length + 1); @@ -199,7 +199,7 @@ INT32 sectionl = ::GetWindowTextLength(::GetDlgItem(*this, IDC_SECTION)); TCHAR *sectionb = new TCHAR[sectionl + 1]; ::GetDlgItemText(*this, IDC_SECTION, sectionb, sectionl + 1); - tString section = sectionb; + tstring section = sectionb; delete[] sectionb; if((section.find(TEXT("Registry")) != string::npos) && !((section.find(TEXT("UserInit")) != string::npos) || (section.find(TEXT("Shell")) != string::npos))) Modified: trunk/BtOrderDlg.cpp =================================================================== --- trunk/BtOrderDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/BtOrderDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -77,7 +77,7 @@ CDialog::OnOK(); } -void BtOrderDlg::CreateBatchDlg::GetData(tString &name, tString §ion) const +void BtOrderDlg::CreateBatchDlg::GetData(tstring &name, tstring §ion) const { name = file; section = place; @@ -130,7 +130,7 @@ void BtOrderDlg::AddToBatchDlg::OnBrowse() { - tString path = BtOrderDlg::OnBrowse(*this, TEXT("Executable (*.exe; *.com; *.bat; *.scr; *.jar; *.cgi)\0*.exe;"\ + tstring path = BtOrderDlg::OnBrowse(*this, TEXT("Executable (*.exe; *.com; *.bat; *.scr; *.jar; *.cgi)\0*.exe;"\ "*.com;*.bat;*.scr;*.jar;*.cgi\0Shortcut (*.lnk; *.pif)\0*.lnk;*.pif\0"\ "Library (*.dll; *.a; *.lib)\0*.dll;*.a;*.lib\0All Files (*.*)\0*.*\0")); if(path.length() > 0) @@ -179,7 +179,7 @@ ofn.nMaxFile = MAX_PATH; ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - tString retVal; + tstring retVal; if(GetOpenFileName(&ofn)) retVal = szFileName; else @@ -195,7 +195,7 @@ ifstream iBatch(path.c_str(), ios::in); if(iBatch) { - tString item; + tstring item; int i = 0; while(!iBatch.eof()) { @@ -229,7 +229,7 @@ { CreateBatchDlg CreateBatchDlg(BootList, *this); CreateBatchDlg.DoModal(); - tString name = TEXT(""); + tstring name = TEXT(""); CreateBatchDlg.GetData(name, section); if(name.length() > 0) @@ -250,7 +250,7 @@ ::EnableWindow(::GetDlgItem(*this, IDNEW), false); ::EnableWindow(::GetDlgItem(*this, IDOPEN), false); - tString name = path.substr(path.find_last_of(TEXT("\\/:")) + 1); + tstring name = path.substr(path.find_last_of(TEXT("\\/:")) + 1); TCHAR *title = new TCHAR[name.length() + 21]; _sntprintf(title, name.length() + 20, TEXT("Boot Order Tool [%s]"), name.c_str()); ::SetWindowText(*this, title); @@ -274,7 +274,7 @@ ::EnableWindow(::GetDlgItem(*this, IDNEW), false); ::EnableWindow(::GetDlgItem(*this, IDOPEN), false); - tString name = path.substr(path.find_last_of(TEXT("\\/:")) + 1); + tstring name = path.substr(path.find_last_of(TEXT("\\/:")) + 1); TCHAR *title = new TCHAR[name.length() + 21]; _sntprintf(title, name.length() + 20, TEXT("Boot Order Tool [%s]"), name.c_str()); ::SetWindowText(*this, title); @@ -319,7 +319,7 @@ if(oBatch) { //add listview content to batch file - tString item; + tstring item; for(INT32 i=0; i<j; i++) { oBatch << TEXT("start "); Modified: trunk/BtOrderDlg.h =================================================================== --- trunk/BtOrderDlg.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/BtOrderDlg.h 2006-07-05 20:57:49 UTC (rev 63) @@ -27,7 +27,7 @@ #include <string> -typedef std::basic_string<TCHAR> tString; +typedef std::basic_string<TCHAR> tstring; using namespace std; using namespace Windows; @@ -42,8 +42,8 @@ private: BtCore *BootList; BOOL browse; - tString path; - tString section; + tstring path; + tstring section; bool browsed; CListView list; @@ -68,12 +68,12 @@ public: CreateBatchDlg(BtCore *&boot, HWND hWndParent = NULL); virtual ~CreateBatchDlg() {} - void GetData(tString &name, tString §ion) const; + void GetData(tstring &name, tstring §ion) const; private: BtCore *core; - tString file; - tString place; + tstring file; + tstring place; virtual BOOL OnInitDialog(); virtual void OnOK(); @@ -87,10 +87,10 @@ public: AddToBatchDlg(HWND hWndParent); virtual ~AddToBatchDlg() {} - tString GetData() const {return command;} + tstring GetData() const {return command;} private: - tString command; + tstring command; virtual BOOL OnInitDialog(); virtual void OnOK(); Modified: trunk/DropDlg.cpp =================================================================== --- trunk/DropDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/DropDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -146,16 +146,16 @@ INT32 length = ::GetWindowTextLength(::GetDlgItem(*this, IDC_SECTION)); TCHAR *buffer = new TCHAR[length + 1]; ::GetDlgItemText(*this, IDC_SECTION, buffer, length + 1); - tString section = buffer; + tstring section = buffer; delete[] buffer; - tString name = file->GetName().erase(file->GetName().length() - file->GetExt().length() - 1, file->GetExt().length() + 1); + tstring name = file->GetName().erase(file->GetName().length() - file->GetExt().length() - 1, file->GetExt().length() + 1); if(section.find(TEXT("Registry")) != string::npos) { if(!((section.find(TEXT("UserInit")) != string::npos) || (section.find(TEXT("Shell")) != string::npos))) { - tString flags = TEXT(""); + tstring flags = TEXT(""); if(exp) { Modified: trunk/LeftView.cpp =================================================================== --- trunk/LeftView.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/LeftView.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -55,7 +55,7 @@ AddItem("Run", 9, 9, tmp); //add sections under registry > current user and registry > all users - tString section = ""; + tstring section = ""; for(INT32 i=BootList->size()-1; i>=0; i--) if(BootList->at(i)->GetLongSection().find("Registry: ") != string::npos) { Modified: trunk/LogDlg.cpp =================================================================== --- trunk/LogDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/LogDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -38,7 +38,7 @@ log.SetPath(szFileName); delete[] szFileName; - tString path = log.GetDir() + TEXT("log.log"); + tstring path = log.GetDir() + TEXT("log.log"); log.SetPath(path); } @@ -51,7 +51,7 @@ { while(!logFile.eof()) { - tString buffer = TEXT(""); + tstring buffer = TEXT(""); getline(logFile, buffer); list.AddItem(buffer.c_str(), i, 0); @@ -143,7 +143,7 @@ ::SendMessage(list, LVM_SETCOLUMNWIDTH, 5, LVSCW_AUTOSIZE_USEHEADER); ::EnableWindow(::GetDlgItem(*this, IDCLEAR), false); - remove(log.GetPath().c_str()); + _tremove(log.GetPath().c_str()); } BOOL LogDlg::DialogProc(HWND hwnd, UINT32 uMsg, WPARAM wParam, LPARAM lParam) Modified: trunk/Logoff.cpp =================================================================== --- trunk/Logoff.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/Logoff.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -18,13 +18,15 @@ #include "Logoff.h" +#include <tchar.h> + CLogoff::CLogoff() { TCHAR buffer[100]; ::GetEnvironmentVariable(TEXT("OS"), buffer, 100); - if(strcmp(TEXT("Windows_NT"), buffer) == 0) + if(_tcscmp(TEXT("Windows_NT"), buffer) == 0) _isWinNT = true; else _isWinNT = false; Modified: trunk/MainFrm.cpp =================================================================== --- trunk/MainFrm.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/MainFrm.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -84,7 +84,7 @@ { //Set application title TCHAR *title = new TCHAR[100]; - _sntprintf(title, 99, "Startup Manager 2.2a :: running on %s", GetWindowsVersion().c_str()); + _sntprintf(title, 99, TEXT("Startup Manager 2.2a :: running on %s"), GetWindowsVersion().c_str()); ::SetWindowText(*this, title); delete[] title; @@ -124,9 +124,9 @@ _sntprintf(select, 29, TEXT("%s"), m_LeftView.GetSelItem()); TCHAR *buffer = new TCHAR[60]; - if((!strcmp(parent, "Current User")) || (!strcmp(parent, "All Users"))) + if((!_tcscmp(parent, TEXT("Current User"))) || (!_tcscmp(parent, TEXT("All Users")))) _sntprintf(buffer, 59, TEXT("Registry\\%s\\%s"), parent, select); - else if((!strcmp(select, "Main")) || (!strcmp(parent, "Main"))) + else if((!_tcscmp(select, TEXT("Main"))) || (!_tcscmp(parent, TEXT("Main")))) _sntprintf(buffer, 59, TEXT("%s"), select); else _sntprintf(buffer, 59, TEXT("%s\\%s"), parent, select); @@ -180,9 +180,9 @@ { TCHAR *buffer = new TCHAR[81]; _sntprintf(buffer, 80, TEXT("%s"), m_RightView.GetItemStr(pos, 1)); - tString section = buffer; + tstring section = buffer; delete[] buffer; - if(section.find("StartUp") != string::npos) + if(section.find(TEXT("StartUp")) != string::npos) { BtFolderItem *item = new BtFolderItem; buffer = new TCHAR[32]; @@ -196,9 +196,9 @@ BootList->Delete(item, section); delete item; } - else if(section.find("Registry") != string::npos) + else if(section.find(TEXT("Registry")) != string::npos) { - if(!((section.find("UserInit") != string::npos) || (section.find("Shell") != string::npos))) + if(!((section.find(TEXT("UserInit")) != string::npos) || (section.find(TEXT("Shell")) != string::npos))) { BtRegItem *item = new BtRegItem; buffer = new TCHAR[32]; @@ -207,11 +207,11 @@ delete[] buffer; buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 2)); - tString flag = buffer; + tstring flag = buffer; delete[] buffer; buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 3)); - tString path = buffer; + tstring path = buffer; delete[] buffer; item->SetCommand(path + ((flag.length() > 0) ? (" " + flag) : "")); BootList->Delete(item, section); @@ -222,14 +222,14 @@ BtWinLogonItem *item = new BtWinLogonItem; buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 3)); - tString path = buffer; + tstring path = buffer; delete[] buffer; item->SetPath(path); BootList->Delete(item, section); delete item; } } - else if(section.find("WinINI") != string::npos) + else if(section.find(TEXT("WinINI")) != string::npos) { BtWininiItem *item = new BtWininiItem; buffer = new TCHAR[MAX_PATH + 1]; @@ -262,7 +262,7 @@ { TCHAR *buffer = new TCHAR[81]; _sntprintf(buffer, 80, TEXT("%s"), m_RightView.GetItemStr(pos, 1)); - tString section = buffer; + tstring section = buffer; delete[] buffer; BtItem *item = new BtItem; buffer = new TCHAR[32]; @@ -271,11 +271,11 @@ delete[] buffer; buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 2)); - tString flag = buffer; + tstring flag = buffer; delete[] buffer; buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 3)); - tString path = buffer; + tstring path = buffer; delete[] buffer; item->SetPath(path + ((flag.length() > 0) ? (" " + flag) : "")); @@ -311,7 +311,7 @@ { TCHAR *buffer = new TCHAR[81]; _sntprintf(buffer, 80, TEXT("%s"), m_RightView.GetItemStr(pos, 1)); - tString section = buffer; + tstring section = buffer; delete[] buffer; BtItem *item = new BtItem; buffer = new TCHAR[32]; @@ -320,13 +320,13 @@ delete[] buffer; buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 3)); - tString path = buffer; + tstring path = buffer; delete[] buffer; item->SetPath(path); buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, TEXT("%s"), m_RightView.GetItemStr(pos, 2)); - tString flag = buffer; + tstring flag = buffer; delete[] buffer; PropDlg PropDlg(item, flag, section, *this); @@ -362,8 +362,8 @@ switch(LOWORD(wParam)) { case IDM_FILE_LOG: OnLog(); break; - case IDM_FILE_MSCONFIG: ::ShellExecute(NULL, "open", "msconfig", NULL, NULL, SW_SHOWNORMAL); break; - case IDM_FILE_REGEDIT: ::ShellExecute(NULL, "open", "regedit", NULL, NULL, SW_SHOWNORMAL); break; + case IDM_FILE_MSCONFIG: ::ShellExecute(NULL, TEXT("open"), TEXT("msconfig"), NULL, NULL, SW_SHOWNORMAL); break; + case IDM_FILE_REGEDIT: ::ShellExecute(NULL, TEXT("open"), TEXT("regedit"), NULL, NULL, SW_SHOWNORMAL); break; case IDM_FILE_EXIT: ::PostQuitMessage(0); break; case IDM_EDIT_ADD: OnAdd(); break; @@ -402,9 +402,9 @@ case IDM_SYSTEM_REBOOT: System.Restart(); break; case IDM_SYSTEM_LOGOFF: System.Logoff(); break; - case IDM_HELP_CONTENTS: ::ShellExecute(NULL, "open", "http://st-m.sf.net", NULL, NULL, SW_SHOWNORMAL); break; - case IDM_HELP_WEBSITE: ::ShellExecute(NULL, "open", "http://st-m.sf.net", NULL, NULL, SW_SHOWNORMAL); break; - case IDM_HELP_SUPPORT: ::ShellExecute(NULL, "open", "https://sourceforge.net/donate/index.php?group_id=137182", NULL, NULL, SW_SHOWNORMAL); break; + case IDM_HELP_CONTENTS: ::ShellExecute(NULL, TEXT("open"), TEXT("http://st-m.sf.net"), NULL, NULL, SW_SHOWNORMAL); break; + case IDM_HELP_WEBSITE: ::ShellExecute(NULL, TEXT("open"), TEXT("http://st-m.sf.net"), NULL, NULL, SW_SHOWNORMAL); break; + case IDM_HELP_SUPPORT: ::ShellExecute(NULL, TEXT("open"), TEXT("https://sourceforge.net/donate/index.php?group_id=137182"), NULL, NULL, SW_SHOWNORMAL); break; case IDM_HELP_ABOUT: OnAbout(); break; } @@ -424,7 +424,7 @@ LPCTSTR buffer = m_RightView.GetItemStr(m_RightView.GetSelPos(), 1); //win.ini and winlogon don't support item names - if(!(!strcmp(buffer, "WinINI\\Load") || !strcmp(buffer, "WinINI\\Run") || !strcmp(buffer, "Registry\\All Users\\Shell") || !strcmp(buffer, "Registry\\All Users\\UserInit"))) + if(!(!_tcscmp(buffer, TEXT("WinINI\\Load")) || !_tcscmp(buffer, TEXT("WinINI\\Run")) || !_tcscmp(buffer, TEXT("Registry\\All Users\\Shell")) || !_tcscmp(buffer, TEXT("Registry\\All Users\\UserInit")))) { m_ToolBar.EnableButton(IDM_EDIT_RENAME); ::EnableMenuItem(::GetSubMenu(GetMenu(), 1), IDM_EDIT_RENAME, MF_BYCOMMAND | MF_ENABLED); Modified: trunk/PropertiesDlg.cpp =================================================================== --- trunk/PropertiesDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/PropertiesDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -25,7 +25,7 @@ using namespace Windows; -PropDlg::PropDlg(BtItem *item, const tString &flags, const string §ion, HWND hWndParent) : CDialog(IDD_PROPERTIES, hWndParent) +PropDlg::PropDlg(BtItem *item, const tstring &flags, const string §ion, HWND hWndParent) : CDialog(IDD_PROPERTIES, hWndParent) { file = item; flag = flags; @@ -48,7 +48,7 @@ //check whether the flags also contain a file if(flag.length() > 0) { - tString flagPath = flag; + tstring flagPath = flag; if(flagPath.find_first_of(TEXT("*-\\/,*")) == 0) { if(flagPath.find(TEXT(" ")) != string::npos) Modified: trunk/PropertiesDlg.h =================================================================== --- trunk/PropertiesDlg.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/PropertiesDlg.h 2006-07-05 20:57:49 UTC (rev 63) @@ -30,13 +30,13 @@ class PropDlg : public CDialog { public: - PropDlg(BtItem *item, const tString &flags, const tString §ion, HWND hWndParent = NULL); + PropDlg(BtItem *item, const tstring &flags, const tstring §ion, HWND hWndParent = NULL); virtual ~PropDlg() {} private: BtItem *file; - tString flag; - tString sect; + tstring flag; + tstring sect; File files[2]; void GetInfo(); Modified: trunk/RenameDlg.cpp =================================================================== --- trunk/RenameDlg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/RenameDlg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -24,7 +24,7 @@ using namespace Windows; -RenameDlg::RenameDlg(BtCore *&boot, BtItem *item, const tString §ion, HWND hWndParent) : CDialog(IDD_RENAME, hWndParent) +RenameDlg::RenameDlg(BtCore *&boot, BtItem *item, const tstring §ion, HWND hWndParent) : CDialog(IDD_RENAME, hWndParent) { BootList = boot; old = item; @@ -57,7 +57,7 @@ INT32 length = ::GetWindowTextLength(::GetDlgItem(*this, IDC_NEWNAME)); TCHAR *buffer = new TCHAR[length + 1]; ::GetDlgItemText(*this, IDC_NEWNAME, buffer, length + 1); - tString newName = buffer; + tstring newName = buffer; delete[] buffer; if(newName.length() > 0) Modified: trunk/RenameDlg.h =================================================================== --- trunk/RenameDlg.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/RenameDlg.h 2006-07-05 20:57:49 UTC (rev 63) @@ -30,13 +30,13 @@ class RenameDlg : public CDialog { public: - RenameDlg(BtCore *&boot, BtItem *item, const tString §ion, HWND hWndParent = NULL); + RenameDlg(BtCore *&boot, BtItem *item, const tstring §ion, HWND hWndParent = NULL); virtual ~RenameDlg() {} private: BtCore *BootList; BtItem *old; - tString sect; + tstring sect; virtual BOOL OnInitDialog(); virtual void OnOK(); Modified: trunk/RightView.cpp =================================================================== --- trunk/RightView.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/RightView.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -19,6 +19,8 @@ #include "rightview.h" #include "resource.h" +#include <tchar.h> + CRightView::~CRightView() { ImageList_Destroy(ListView_GetImageList(*this, LVSIL_SMALL)); @@ -84,7 +86,7 @@ } //write data from specified section to m_RightView -void CRightView::DataToList(const tString §ion) +void CRightView::DataToList(const tstring §ion) { Clear(); @@ -160,7 +162,7 @@ LPCTSTR buffer = GetItemStr(GetSelPos(), 1); //win.ini and winlogon don't support item names - if(!strcmp(buffer, "WinINI\\Load") || !strcmp(buffer, "WinINI\\Run") || !strcmp(buffer, "Registry\\All Users\\Shell") || !strcmp(buffer, "Registry\\All Users\\UserInit")) + if(!_tcscmp(buffer, "WinINI\\Load") || !_tcscmp(buffer, "WinINI\\Run") || !_tcscmp(buffer, "Registry\\All Users\\Shell") || !_tcscmp(buffer, "Registry\\All Users\\UserInit")) ::EnableMenuItem(hPopupMenu, IDM_EDIT_RENAME, MF_BYCOMMAND | MF_GRAYED); } else Modified: trunk/RightView.h =================================================================== --- trunk/RightView.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/RightView.h 2006-07-05 20:57:49 UTC (rev 63) @@ -35,7 +35,7 @@ virtual HWND Create(HWND hWndParent); void AddItem(LPCTSTR pszText, INT32 iItem, INT32 iSubItem, HICON iImage = NULL); void UpdateColumns(); - void DataToList(const tString §ion); + void DataToList(const tstring §ion); virtual void OnCreate(); void SetCoreObj(BtCore *&BtList) {BootList = BtList;} BOOL OnNotify(LPARAM lParam); Modified: trunk/Startup Manager_DEBUG.dev =================================================================== --- trunk/Startup Manager_DEBUG.dev 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/Startup Manager_DEBUG.dev 2006-07-05 20:57:49 UTC (rev 63) @@ -11,7 +11,7 @@ ResourceIncludes= MakeIncludes= Compiler= -CppCompiler=-D_DEBUG_@@__@@_ +CppCompiler=-D_DEBUG_@@_-D_UNICODE_@@_ Linker=-lcomctl32_@@_-lole32_@@_-lolepro32_@@_-luuid_@@_-lversion_@@_-lshell32_@@_ IsCpp=1 Icon= Modified: trunk/boot/BtCore.cpp =================================================================== --- trunk/boot/BtCore.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtCore.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -40,12 +40,12 @@ { BtWinini *winini; winini = new BtWinini; - winini->section = "WinINI\\Run"; - winini->part = "Run"; + winini->section = TEXT("WinINI\\Run"); + winini->part = TEXT("Run"); push_back(winini); winini = new BtWinini; - winini->section = "WinINI\\Load"; - winini->part = "Load"; + winini->section = TEXT("WinINI\\Load"); + winini->part = TEXT("Load"); push_back(winini); } @@ -75,66 +75,66 @@ registry->root = HKEY_LOCAL_MACHINE; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunServicesOnce"; - registry->section = "Registry\\All Users\\Run Services Once"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunServicesOnce"); + registry->section = TEXT("Registry\\All Users\\Run Services Once"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_LOCAL_MACHINE; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunServices"; - registry->section = "Registry\\All Users\\Run Services"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunServices"); + registry->section = TEXT("Registry\\All Users\\Run Services"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_LOCAL_MACHINE; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx"; - registry->section = "Registry\\All Users\\Run Once Ex"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx"); + registry->section = TEXT("Registry\\All Users\\Run Once Ex"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_LOCAL_MACHINE; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"; - registry->section = "Registry\\All Users\\Run Once"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"); + registry->section = TEXT("Registry\\All Users\\Run Once"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_LOCAL_MACHINE; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunEx"; - registry->section = "Registry\\All Users\\Run Ex"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunEx"); + registry->section = TEXT("Registry\\All Users\\Run Ex"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_LOCAL_MACHINE; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"; - registry->section = "Registry\\All Users\\Run"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); + registry->section = TEXT("Registry\\All Users\\Run"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); } //add logon sections BtWinLogon *logon; logon = new BtWinLogon; - logon->section = "Registry\\All Users\\Shell"; - logon->part = "Shell"; + logon->section = TEXT("Registry\\All Users\\Shell"); + logon->part = TEXT("Shell"); push_back(logon); logon = new BtWinLogon; - logon->section = "Registry\\All Users\\UserInit"; - logon->part = "UserInit"; + logon->section = TEXT("Registry\\All Users\\UserInit"); + logon->part = TEXT("UserInit"); push_back(logon); //current user keys: @@ -145,36 +145,36 @@ registry->root = HKEY_CURRENT_USER; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx"; - registry->section = "Registry\\Current User\\Run Once Ex"; - if(i == 1) registry->section = registry->section + "(64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx"); + registry->section = TEXT("Registry\\Current User\\Run Once Ex"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_CURRENT_USER; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"; - registry->section = "Registry\\Current User\\Run Once"; - if(i == 1) registry->section = registry->section + "(64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"); + registry->section = TEXT("Registry\\Current User\\Run Once"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_CURRENT_USER; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunEx"; - registry->section = "Registry\\Current User\\Run Ex"; - if(i == 1) registry->section = registry->section + " (64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunEx"); + registry->section = TEXT("Registry\\Current User\\Run Ex"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); registry = new BtRegistry; registry->root = HKEY_CURRENT_USER; if(i == 1) registry->dwHiveFlag = X64KEY; if(i == 2) registry->dwHiveFlag = nAccess; - registry->regkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"; - registry->section = "Registry\\Current User\\Run"; - if(i == 1) registry->section = registry->section + "(64-bit)"; + registry->regkey = TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); + registry->section = TEXT("Registry\\Current User\\Run"); + if(i == 1) registry->section = registry->section + TEXT(" (64-bit)"); if(IsKeyExist(registry)) push_back(registry); } } @@ -183,11 +183,11 @@ { BtFolder *folder; folder = new BtFolder; - folder->section = "StartUp\\All Users"; + folder->section = TEXT("StartUp\\All Users"); folder->user = ALL; push_back(folder); folder = new BtFolder; - folder->section = "StartUp\\Current User"; + folder->section = TEXT("StartUp\\Current User"); folder->user = CURRENT; push_back(folder); } @@ -225,7 +225,7 @@ } } - void BtCore::Add(BtItem *item, const tString §ion) + void BtCore::Add(BtItem *item, const tstring §ion) { try { @@ -258,7 +258,7 @@ } } - void BtCore::Delete(BtItem *item, const tString §ion) + void BtCore::Delete(BtItem *item, const tstring §ion) { try { @@ -291,7 +291,7 @@ } } - void BtCore::Rename(BtItem *item, const tString §ion, const tString &newName) + void BtCore::Rename(BtItem *item, const tstring §ion, const tstring &newName) { try { @@ -332,15 +332,15 @@ return count; } - INT32 BtCore::GetItemCount(const tString §ion) const + INT32 BtCore::GetItemCount(const tstring §ion) const { - if(section == "Main") + if(section == TEXT("Main")) { //all sections return GetItemCount(); } - else if((section == "StartUp") || (section == "WinINI") || (section == "Registry") - || (section == "Registry\\Current User") || (section == "Registry\\All Users")) + else if((section == TEXT("StartUp")) || (section == TEXT("WinINI")) || (section == TEXT("Registry")) + || (section == TEXT("Registry\\Current User")) || (section == TEXT("Registry\\All Users"))) { //search the right section in the list INT32 count = 0; @@ -362,16 +362,16 @@ return 0; } - void BtCore::Enumerate(const tString §ion, void proc(BtItem *node)) + void BtCore::Enumerate(const tstring §ion, void proc(BtItem *node)) { - if(section == "Main") + if(section == TEXT("Main")) { //all sections for(INT32 i=0; i<size(); i++) at(i)->Enumerate(proc); } - else if((section == "StartUp") || (section == "WinINI") || (section == "Registry") - || (section == "Registry\\Current User") || (section == "Registry\\All Users")) + else if((section == TEXT("StartUp")) || (section == TEXT("WinINI")) || (section == TEXT("Registry")) + || (section == TEXT("Registry\\Current User")) || (section == TEXT("Registry\\All Users"))) { //search the right section in the list for(INT32 i=0; i<size(); i++) @@ -392,7 +392,7 @@ } } - tString BtCore::GetSection(const tString §ion) const + tstring BtCore::GetSection(const tstring §ion) const { //search the right section in the list INT32 i = 0; @@ -416,7 +416,7 @@ File log; log.SetPath(szFileName); delete[] szFileName; - path = log.GetDir() + "log.log"; + path = log.GetDir() + TEXT("log.log"); st_pLog = this; } @@ -432,18 +432,18 @@ return st_pLog; } - tString BtLog::GetUserName() + tstring BtLog::GetUserName() { TCHAR cUserName[100]; DWORD32 nUserName = sizeof(cUserName); ::GetUserName(cUserName, reinterpret_cast<DWORD_PTR*>(&nUserName)); - tString user = cUserName; + tstring user = cUserName; return user; } void BtLog::Log(LogInfo info) { - tString action[] = {"added", "removed", "renamed", "modified"}; + tstring action[] = {TEXT("added"), TEXT("removed"), TEXT("renamed"), TEXT("modified")}; TCHAR timebuf[128], datebuf[128]; _tzset(); @@ -456,7 +456,7 @@ oLogFile.seekp(ios::end); oLogFile << info.item.c_str() << endl; oLogFile << action[info.action].c_str() << endl; - tString user = (info.section.find("Current User") != string::npos) ? GetUserName().c_str() : "All Users"; + tstring user = (info.section.find(TEXT("Current User")) != string::npos) ? GetUserName().c_str() : TEXT("All Users"); oLogFile << user.c_str() << endl; oLogFile << info.section.c_str() << endl; oLogFile << datebuf << endl; @@ -464,7 +464,7 @@ oLogFile.close(); } else - ::MessageBox(NULL, "Couldn't write to log", "Exception", MB_OK | MB_ICONWARNING); + ::MessageBox(NULL, TEXT("Couldn't write to log"), TEXT("Exception"), MB_OK | MB_ICONWARNING); } } //namespace Boot Modified: trunk/boot/BtCore.h =================================================================== --- trunk/boot/BtCore.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtCore.h 2006-07-05 20:57:49 UTC (rev 63) @@ -29,7 +29,7 @@ #include "BtWinini.h" #include "BtReg.h" -typedef std::basic_string<TCHAR> tString; +typedef std::basic_string<TCHAR> tstring; using namespace std; @@ -45,13 +45,13 @@ void AddRegistrySections(); void AddFolderSections(); void Init(); - void Add(BtItem *item, const tString §ion); - void Delete(BtItem *item, const tString §ion); - void Rename(BtItem *item, const tString §ion, const tString &newName); + void Add(BtItem *item, const tstring §ion); + void Delete(BtItem *item, const tstring §ion); + void Rename(BtItem *item, const tstring §ion, const tstring &newName); INT32 GetItemCount() const; - INT32 GetItemCount(const tString §ion) const; - void Enumerate(const tString §ion, void proc(BtItem *node)); - tString GetSection(const tString §ion) const; + INT32 GetItemCount(const tstring §ion) const; + void Enumerate(const tstring §ion, void proc(BtItem *node)); + tstring GetSection(const tstring §ion) const; private: BOOL IsKeyExist(BtRegistry *registry); @@ -62,8 +62,8 @@ class LogInfo { public: - tString item; - tString section; + tstring item; + tstring section; BtAction action; }; @@ -75,12 +75,12 @@ static BtLog* GetLog(); private: - tString path; + tstring path; BtLog(); //Prevent normal construction BtLog(const BtLog&); //Prevent copy construction BtLog& operator= (const BtLog&); //Prevent copy construction - tString GetUserName(); + tstring GetUserName(); static BtLog* st_pLog; }; Modified: trunk/boot/BtFolder.cpp =================================================================== --- trunk/boot/BtFolder.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtFolder.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -25,20 +25,20 @@ namespace Boot { - bool BtFolderItem::Create(File file, const tString &Dir, const tString &Name) + bool BtFolderItem::Create(File file, const tstring &Dir, const tstring &Name) { path = file.CreateShortcut(Dir, Name); return (path.length() > 0); } - bool BtFolderItem::Create(const tString &Path, const tString &Dir, const tString &Name) + bool BtFolderItem::Create(const tstring &Path, const tstring &Dir, const tstring &Name) { File file; file.SetPath(Path); return Create(file, Dir, Name); } - tString BtFolderItem::ResolveLinkTarget() + tstring BtFolderItem::ResolveLinkTarget() { assert(path.length() > 0); @@ -47,7 +47,7 @@ TCHAR szGotPath[MAX_PATH + 1], szDescription[MAX_PATH + 1]; WIN32_FIND_DATA wfd; LPTSTR pszPath = TEXT(""); // assume failure - tString ret; + tstring ret; CoInitialize(NULL); @@ -73,7 +73,7 @@ hres = psl->Resolve(NULL, SLR_ANY_MATCH); if(SUCCEEDED(hres)) { - strcpy(szGotPath, path.c_str()); + _tcscpy(szGotPath, path.c_str()); // Get the path to the link target. hres = psl->GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH); pszPath = szGotPath; @@ -145,7 +145,7 @@ //read files from directory while((file = readdir(dir)) != NULL) if(strlen(file->d_name) > 2) - if(strcmp(file->d_name, "desktop.ini")) + if(_tcscmp(file->d_name, "desktop.ini")) { buffer = new TCHAR[MAX_PATH + 1]; _sntprintf(buffer, MAX_PATH, "%s\\%s", path, file->d_name); @@ -217,7 +217,7 @@ items--; } - void BtFolder::Rename(BtItem *item, const tString &newName) + void BtFolder::Rename(BtItem *item, const tstring &newName) { assert(typeid(*item) == typeid(BtFolderItem)); assert(section.length() > 0); @@ -226,7 +226,7 @@ //rename item SelNode(static_cast<BtFolderItem*>(item)); BtFolderItem *tmp = static_cast<BtFolderItem*>(GetNode()); - tString newPath = static_cast<BtFolderItem*>(item)->GetDir() + newName + ".lnk"; + tstring newPath = static_cast<BtFolderItem*>(item)->GetDir() + newName + ".lnk"; tmp->Rename(newPath); tmp->SetiName(tmp->GetName()); } Modified: trunk/boot/BtFolder.h =================================================================== --- trunk/boot/BtFolder.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtFolder.h 2006-07-05 20:57:49 UTC (rev 63) @@ -38,9 +38,9 @@ public: BtFolderItem() : BtItem() {} virtual ~BtFolderItem() {} - bool Create(File file, const tString &Dir, const tString &Name); - bool Create(const tString &Path, const tString &Dir, const tString &Name); - tString ResolveLinkTarget(); + bool Create(File file, const tstring &Dir, const tstring &Name); + bool Create(const tstring &Path, const tstring &Dir, const tstring &Name); + tstring ResolveLinkTarget(); virtual void GetProperties(DLLINFO &info); }; @@ -54,8 +54,8 @@ virtual void Read(); virtual void Add(BtItem *item); virtual void Delete(BtItem *item); - virtual void Rename(BtItem *item, const tString &newName); - virtual tString GetLongSection() const {return section;} + virtual void Rename(BtItem *item, const tstring &newName); + virtual tstring GetLongSection() const {return section;} }; } //namespace Boot Modified: trunk/boot/BtReg.cpp =================================================================== --- trunk/boot/BtReg.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtReg.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -21,14 +21,14 @@ namespace Boot { - void BtRegItem::SetPathFlags(const tString &file, const tString &flag) + void BtRegItem::SetPathFlags(const tstring &file, const tstring &flag) { path = file; flags = flag; cmd = path + ((flags.length() > 0) ? (TEXT(" ") + flags) : TEXT("")); } - tString BtRegItem::GetFlags() + tstring BtRegItem::GetFlags() { if(flags.length() <= 0) SeparateFlags(); @@ -47,7 +47,7 @@ return false; } - tString buffer = TEXT(""); + tstring buffer = TEXT(""); for(INT32 i=0; i<cmd.length(); i++) buffer += tolower(cmd.at(i)); @@ -133,7 +133,7 @@ } /****************************************************************************/ - void BtRegItem::SetCommand(const tString &command) + void BtRegItem::SetCommand(const tstring &command) { cmd = command; if(!SeparateFlags()) @@ -255,7 +255,7 @@ ::RegCloseKey(hKeyWrite); } - void BtRegistry::Rename(BtItem *item, const tString &newName) + void BtRegistry::Rename(BtItem *item, const tstring &newName) { assert(typeid(*item) == typeid(BtRegItem)); assert(section.length() > 0); @@ -290,9 +290,9 @@ ::RegCloseKey(hKeyWrite); } - tString BtRegistry::GetLongSection() const + tstring BtRegistry::GetLongSection() const { - tString ret = TEXT("Registry: ") + regkey + ((dwHiveFlag == X64KEY) ? TEXT(" (64-bit)") : TEXT("")); + tstring ret = TEXT("Registry: ") + regkey + ((dwHiveFlag == X64KEY) ? TEXT(" (64-bit)") : TEXT("")); return ret; } Modified: trunk/boot/BtReg.h =================================================================== --- trunk/boot/BtReg.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtReg.h 2006-07-05 20:57:49 UTC (rev 63) @@ -37,32 +37,32 @@ class BtRegItem : public BtItem { public: - BtRegItem() : cmd(TEXT("")), BtItem() {} + BtRegItem() : BtItem() {cmd = TEXT("");} virtual ~BtRegItem() {} - void SetPathFlags(const tString &file, const tString &flag); - virtual tString GetFlags(); - void SetCommand(const tString &command); - tString GetCommand() const {return cmd;} + void SetPathFlags(const tstring &file, const tstring &flag); + virtual tstring GetFlags(); + void SetCommand(const tstring &command); + tstring GetCommand() const {return cmd;} protected: bool SeparateFlags(); - tString cmd; + tstring cmd; }; class BtRegistry : virtual public BtSection { public: HKEY root; - tString regkey; + tstring regkey; KEYBITS dwHiveFlag; //32 or 64 bit key - BtRegistry() : root(0), regkey(TEXT("")), BtSection() {} + BtRegistry() : root(0), BtSection() {regkey = TEXT("");} virtual ~BtRegistry() {} virtual void Read(); virtual void Add(BtItem *item); virtual void Delete(BtItem *item); - virtual void Rename(BtItem *item, const tString &newName); - virtual tString GetLongSection() const; + virtual void Rename(BtItem *item, const tstring &newName); + virtual tstring GetLongSection() const; }; } //namespace Boot Modified: trunk/boot/BtSection.cpp =================================================================== --- trunk/boot/BtSection.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtSection.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -276,7 +276,7 @@ throw(CBootException(TEXT("Polymorfism failure in Delete() procedure..."))); } - void BtSection::Rename(BtItem *item, const tString &newName) + void BtSection::Rename(BtItem *item, const tstring &newName) { throw(CBootException(TEXT("Polymorfism failure in Rename procedure..."))); } Modified: trunk/boot/BtSection.h =================================================================== --- trunk/boot/BtSection.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtSection.h 2006-07-05 20:57:49 UTC (rev 63) @@ -25,7 +25,7 @@ #include "File.h" -typedef std::basic_string<TCHAR> tString; +typedef std::basic_string<TCHAR> tstring; using namespace std; @@ -50,9 +50,9 @@ public: BtItem(); virtual ~BtItem(); - virtual void SetiName(const tString &name) {item = name;} - tString GetiName() const {return item;} - virtual tString GetFlags() const {return flags;} + virtual void SetiName(const tstring &name) {item = name;} + tstring GetiName() const {return item;} + virtual tstring GetFlags() const {return flags;} bool IsEnabled() const {return enabled;} virtual void Enable() {} virtual void Disable() {} @@ -62,8 +62,8 @@ BtItem *prev; protected: - tString item; - tString flags; + tstring item; + tstring flags; bool enabled; }; @@ -97,15 +97,15 @@ class BtSection : public BtList { public: - tString section; + tstring section; - BtSection() : section(""), BtList() {} + BtSection() : BtList() {section = TEXT("");} virtual ~BtSection() {} virtual void Read(); virtual void Add(BtItem *item); virtual void Delete(BtItem *item); - virtual void Rename(BtItem *item, const tString &newName); - virtual tString GetLongSection() const {return TEXT("Main");} + virtual void Rename(BtItem *item, const tstring &newName); + virtual tstring GetLongSection() const {return section;} }; class CBootException Modified: trunk/boot/BtWinLogon.cpp =================================================================== --- trunk/boot/BtWinLogon.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtWinLogon.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -22,7 +22,7 @@ namespace Boot { - void BtWinLogonItem::SetPath(const tString &file) + void BtWinLogonItem::SetPath(const tstring &file) { path = file; item = GetName(); @@ -33,7 +33,7 @@ assert(section.length() > 0); assert((part == TEXT("UserInit")) || (part == TEXT("Shell"))); - tString FileToAdd, ThePath; + tstring FileToAdd, ThePath; //read winlogon HKEY hKey = 0; @@ -154,7 +154,7 @@ if(strlen(szValue) > 0) { - tString stbuffer = szValue; + tstring stbuffer = szValue; INT32 BeginPos = 0; //try to find the item we want to remove if((BeginPos = stbuffer.find(static_cast<BtWinLogonItem*>(item)->GetPath().c_str())) != string::npos) @@ -184,9 +184,9 @@ } } - tString BtWinLogon::GetLongSection() const + tstring BtWinLogon::GetLongSection() const { - tString ret = TEXT("Registry: SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon (") + part + TEXT(")"); + tstring ret = TEXT("Registry: SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon (") + part + TEXT(")"); return ret; } Modified: trunk/boot/BtWinLogon.h =================================================================== --- trunk/boot/BtWinLogon.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtWinLogon.h 2006-07-05 20:57:49 UTC (rev 63) @@ -29,21 +29,21 @@ public: BtWinLogonItem() : BtItem() {} virtual ~BtWinLogonItem() {} - virtual void SetiName(const tString &name) {} - virtual void SetPath(const tString &file); + virtual void SetiName(const tstring &name) {} + virtual void SetPath(const tstring &file); }; class BtWinLogon : virtual public BtSection { public: - tString part; //"UserInit" or "Shell" + tstring part; //"UserInit" or "Shell" - BtWinLogon() : part(TEXT("")), BtSection() {} + BtWinLogon() : BtSection() {part = TEXT("");} virtual ~BtWinLogon() {} virtual void Read(); virtual void Add(BtItem *item); virtual void Delete(BtItem *item); - virtual string GetLongSection() const; + virtual tstring GetLongSection() const; }; } //namespace Boot Modified: trunk/boot/BtWinini.cpp =================================================================== --- trunk/boot/BtWinini.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtWinini.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -22,7 +22,7 @@ namespace Boot { - void BtWininiItem::SetPath(const tString &file) + void BtWininiItem::SetPath(const tstring &file) { path = file; item = GetName(); @@ -41,8 +41,8 @@ //if there's an item in the win.ini section we're reading if(strlen(path) > 0) { - tString FileToAdd = path; - tString ThePath = TEXT(""); + tstring FileToAdd = path; + tstring ThePath = TEXT(""); BtWininiItem *item; //search for spaces, this is what separates items in win.ini @@ -124,7 +124,7 @@ { if(strlen(FilePath) > 0) { - tString stbuffer = FilePath; + tstring stbuffer = FilePath; INT32 BeginPos = 0; //try to find the item we want to remove if((BeginPos = stbuffer.find(static_cast<BtWininiItem*>(item)->GetPath().c_str())) != string::npos) Modified: trunk/boot/BtWinini.h =================================================================== --- trunk/boot/BtWinini.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/BtWinini.h 2006-07-05 20:57:49 UTC (rev 63) @@ -29,21 +29,21 @@ public: BtWininiItem() : BtItem() {} virtual ~BtWininiItem() {} - virtual void SetiName(const tString &name) {} - virtual void SetPath(const tString &file); + virtual void SetiName(const tstring &name) {} + virtual void SetPath(const tstring &file); }; class BtWinini : virtual public BtSection { public: - tString part; //"load" or "run" + tstring part; //"load" or "run" - BtWinini() : part(TEXT("")), BtSection() {} + BtWinini() : BtSection() {part = TEXT("");} virtual ~BtWinini() {} virtual void Read(); virtual void Add(BtItem *item); virtual void Delete(BtItem *item); - virtual tString GetLongSection() const {return section;} + virtual tstring GetLongSection() const {return section;} }; } //namespace Boot Modified: trunk/boot/File.cpp =================================================================== --- trunk/boot/File.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/File.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -23,7 +23,7 @@ #include <sys/stat.h> #include <assert.h> -tString File::GetExt() +tstring File::GetExt() { assert(path.length() > 0); @@ -35,7 +35,7 @@ return ""; } -tString File::GetName() +tstring File::GetName() { assert(path.length() > 0); @@ -47,12 +47,12 @@ return path; } -tString File::GetDir() +tstring File::GetDir() { assert(path.length() > 0); - tString name = GetName(); - tString dir = path; + tstring name = GetName(); + tstring dir = path; dir.erase(path.length() - name.length(), name.length()); // if no directory specified, it should be one of the system directories @@ -110,13 +110,13 @@ return fi.hIcon; } -void File::Rename(const tString &newpath) +void File::Rename(const tstring &newpath) { assert(path.length() > 0); assert(newpath.length() > 0); - tString fullpath = GetDir() + GetName(); - rename(fullpath.c_str(), newpath.c_str()); + tstring fullpath = GetDir() + GetName(); + _trename(fullpath.c_str(), newpath.c_str()); path = newpath; } @@ -124,7 +124,7 @@ { assert(path.length() > 0); - tString fullpath = GetDir() + GetName(); + tstring fullpath = GetDir() + GetName(); /*HANDLE hFile = ::CreateFile(fullpath.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if(hFile != INVALID_HANDLE_VALUE) @@ -137,7 +137,7 @@ return (stat(fullpath.c_str(), &buf) == 0); } -tString File::CreateShortcut(const tString &Dir, const tString &Name) +tstring File::CreateShortcut(const tstring &Dir, const tstring &Name) { assert(path.length() > 0); assert(Dir.length() > 0); @@ -145,13 +145,13 @@ if(SUCCEEDED(CoInitialize(NULL))) { - tString location = Dir + TEXT("\\") + Name + TEXT(".lnk"); + tstring location = Dir + TEXT("\\") + Name + TEXT(".lnk"); IShellLink *pLink; IPersistFile *pPersistFile; if(SUCCEEDED(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void**)&pLink))) { - tString fullpath = GetDir() + GetName(); + tstring fullpath = GetDir() + GetName(); pLink->SetPath(fullpath.c_str()); pLink->SetDescription(GetName().c_str()); pLink->SetShowCmd(SW_SHOW); Modified: trunk/boot/File.h =================================================================== --- trunk/boot/File.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/File.h 2006-07-05 20:57:49 UTC (rev 63) @@ -20,29 +20,30 @@ #define FILE_H #include "cLibraryInfo.h" +#include <tchar.h> using namespace std; class File { public: - File() : path(TEXT("")) {} + File() {path = TEXT("");} virtual ~File() {} - virtual void SetPath(const tString &file) {path = file;} - tString GetPath() const {return path;} - tString GetExt(); - tString GetName(); - tString GetDir(); + virtual void SetPath(const tstring &file) {path = file;} + tstring GetPath() const {return path;} + tstring GetExt(); + tstring GetName(); + tstring GetDir(); HICON GetIcon(); - void Rename(const tString &newpath); - void Delete() {remove(path.c_str());} + void Rename(const tstring &newpath); + void Delete() {_tremove(path.c_str());} bool IsExist(); - tString CreateShortcut(const tString &Dir, const tString &Name); + tstring CreateShortcut(const tstring &Dir, const tstring &Name); virtual void GetProperties(DLLINFO &info); protected: - tString path; + tstring path; }; #endif Modified: trunk/boot/ShortCut.cpp =================================================================== --- trunk/boot/ShortCut.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/ShortCut.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -19,21 +19,22 @@ #include "ShortCut.h" #include <shlobj.h> #include <assert.h> +#include <tchar.h> -bool ShortCut::Create(File file, const tString &Dir, const tString &Name) +bool ShortCut::Create(File file, const tstring &Dir, const tstring &Name) { path = file.CreateShortcut(Dir, Name); return (path.length() > 0); } -bool ShortCut::Create(const string &Path, const tString &Dir, const tString &Name) +bool ShortCut::Create(const string &Path, const tstring &Dir, const tstring &Name) { File file; file.SetPath(Path); return Create(file, Dir, Name); } -tString ShortCut::ResolveLinkTarget() +tstring ShortCut::ResolveLinkTarget() { assert(path.length() > 0); @@ -42,7 +43,7 @@ TCHAR szGotPath[MAX_PATH + 1], szDescription[MAX_PATH + 1]; WIN32_FIND_DATA wfd; LPTSTR pszPath = TEXT(""); // assume failure - tString ret; + tstring ret; CoInitialize(NULL); @@ -68,7 +69,7 @@ hres = psl->Resolve(NULL, SLR_ANY_MATCH); if(SUCCEEDED(hres)) { - strcpy(szGotPath, path.c_str()); + _tcscpy(szGotPath, path.c_str()); // Get the path to the link target. hres = psl->GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&wfd, SLGP_SHORTPATH); pszPath = szGotPath; Modified: trunk/boot/ShortCut.h =================================================================== --- trunk/boot/ShortCut.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/ShortCut.h 2006-07-05 20:57:49 UTC (rev 63) @@ -27,9 +27,9 @@ ShortCut() : File() {} virtual ~ShortCut() {} - bool Create(File file, const tString &Dir, const tString &Name); - bool Create(const tString &Path, const tString &Dir, const tString &Name); - tString ResolveLinkTarget(); + bool Create(File file, const tstring &Dir, const tstring &Name); + bool Create(const tstring &Path, const tstring &Dir, const tstring &Name); + tstring ResolveLinkTarget(); virtual void GetProperties(DLLINFO &info); }; Modified: trunk/boot/cLibraryInfo.h =================================================================== --- trunk/boot/cLibraryInfo.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/boot/cLibraryInfo.h 2006-07-05 20:57:49 UTC (rev 63) @@ -25,7 +25,7 @@ #include <shlobj.h> #include <string> -typedef std::basic_string<TCHAR> tString; +typedef std::basic_string<TCHAR> tstring; using namespace std; @@ -42,7 +42,7 @@ LPCTSTR stOriginalName; LPCTSTR stProductName; LPCTSTR stProductVersion; - tString stDllVersion; + tstring stDllVersion; LPCTSTR stFileOS; LPCTSTR stFileType; LPCTSTR stLanguageId; Modified: trunk/windows/HyperLink.cpp =================================================================== --- trunk/windows/HyperLink.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/windows/HyperLink.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -19,6 +19,7 @@ #include "HyperLink.h" #include <shellapi.h> +#include <tchar.h> LRESULT CALLBACK HyperLink_CtlProc(HWND hwnd, UINT32 msg, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK HyperLink_DlgProc(HWND hwnd, UINT32 msg, WPARAM wParam, LPARAM lParam); @@ -31,13 +32,13 @@ HWND hctl = ::GetDlgItem(hwnd, ctrl); ::SetWindowText(hctl, name); - HGLOBAL hold = (HGLOBAL)::GetProp(hctl, "href_dat"); + HGLOBAL hold = (HGLOBAL)::GetProp(hctl, TEXT("href_dat")); if(hold != NULL) { URLPROPS *ud = (URLPROPS*)::GlobalLock(hold); delete[] ud->url; ud->url = new TCHAR[strlen(url) + 1]; - strcpy(ud->url, url); + _tcscpy(ud->url, url); } else { @@ -45,15 +46,15 @@ URLPROPS *ud = (URLPROPS*)::GlobalLock(hglob); ud->oldproc = (WNDPROC)::GetWindowLongPtr(hctl, GWL_WNDPROC); ud->url = new TCHAR[strlen(url) + 1]; - strcpy(ud->url, url); + _tcscpy(ud->url, url); ud->hf = 0; ud->BkColor = 0; ::GlobalUnlock(hglob); - ::SetProp(hctl, "href_dat", hglob); + ::SetProp(hctl, TEXT("href_dat"), hglob); ::SetWindowLongPtr(hctl, GWL_WNDPROC, (LONG_PTR)HyperLink_CtlProc); } - hold = (HGLOBAL)::GetProp(hwnd, "href_dlg"); + hold = (HGLOBAL)::GetProp(hwnd, TEXT("href_dlg")); if(hold == NULL) { HGLOBAL hglob = ::GlobalAlloc(GMEM_MOVEABLE, sizeof(URLPROPS)); @@ -63,7 +64,7 @@ ud->BkColor = BkColor; ud->hf = 0; ::GlobalUnlock(hglob); - ::SetProp(hwnd, "href_dlg", hglob); + ::SetProp(hwnd, TEXT("href_dlg"), hglob); ::SetWindowLongPtr(hwnd, GWL_WNDPROC, (LONG_PTR)HyperLink_DlgProc); } @@ -74,7 +75,7 @@ { HWND hdlg; - HGLOBAL hglob = (HGLOBAL)::GetProp(hwnd, "href_dat"); + HGLOBAL hglob = (HGLOBAL)::GetProp(hwnd, TEXT("href_dat")); if(hglob == NULL) return ::DefWindowProc(hwnd, msg, wParam, lParam); @@ -85,7 +86,7 @@ switch(msg) { case WM_DESTROY: - ::RemoveProp(hwnd, "href_dat"); + ::RemoveProp(hwnd, TEXT("href_dat")); ::GlobalFree(hglob); if(ud.url != 0) delete[] ud.url; @@ -102,7 +103,7 @@ if(hdlg == 0) hdlg = hwnd; - ::ShellExecute(hdlg, "open", ud.url, NULL, NULL, SW_SHOWNORMAL); + ::ShellExecute(hdlg, TEXT("open"), ud.url, NULL, NULL, SW_SHOWNORMAL); break; case WM_MOUSEMOVE: @@ -124,7 +125,7 @@ TEXTMETRIC tm; LOGFONT lf; - HGLOBAL hglob = (HGLOBAL)::GetProp(hwnd, "href_dlg"); + HGLOBAL hglob = (HGLOBAL)::GetProp(hwnd, TEXT("href_dlg")); if(hglob == NULL) return ::DefWindowProc(hwnd, msg, wParam, lParam); @@ -135,7 +136,7 @@ switch(msg) { case WM_DESTROY: - ::RemoveProp(hwnd, "href_dlg"); + ::RemoveProp(hwnd, TEXT("href_dlg")); ::GlobalFree(hglob); if(ud.hf != 0) @@ -146,7 +147,7 @@ hdc = (HDC)wParam; hctl = (HWND)lParam; - hprop = ::GetProp(hctl, "href_dat"); + hprop = ::GetProp(hctl, TEXT("href_dat")); if(hprop == NULL) return CallWindowProc(ud.oldproc, hwnd, msg, wParam, lParam); Modified: trunk/windows/WinCore.h =================================================================== --- trunk/windows/WinCore.h 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/windows/WinCore.h 2006-07-05 20:57:49 UTC (rev 63) @@ -130,7 +130,7 @@ CWinClass(const CWinClass& CopyClass); virtual ~CWinClass() {} virtual BOOL RegisterClassEx(); - operator LPCTSTR() {return m_wc.lpszClassName;} + operator LPCTSTR() {return (LPCTSTR)m_wc.lpszClassName;} virtual WNDCLASSEX GetWndClassEx() {return m_wc;} virtual void SetWndClassEx(WNDCLASSEX wc) {m_wc = wc; m_wc.lpfnWndProc = CWin::StaticWindowProc;} Modified: trunk/windows/WinTools.cpp =================================================================== --- trunk/windows/WinTools.cpp 2006-07-05 16:42:16 UTC (rev 62) +++ trunk/windows/WinTools.cpp 2006-07-05 20:57:49 UTC (rev 63) @@ -24,10 +24,10 @@ #define VER_SUITE_EMBEDDEDNT 0x00000040 //get windows version string -tString GetWindowsVersion() +tstring GetWindowsVersion() { TCHAR *Version = new TCHAR[100]; - tString ret = TEXT(""); + tstring ret = TEXT(""); BOOL VerEx; OSVERSIONINFOEX OS; @@ -285,6 +285,6 @@ { TCHAR buffer[100]; ::GetEnvironmentVariable(TEXT("OS"), buffer, 99); - if(strcmp(TEXT("Windows_NT"), buffer) == 0) return TRUE; + if(_tcscmp(TEXT("Windows_NT"), buffer) == 0) return TRUE; return FALSE; } Modified:... [truncated message content] |