QuickLaunchBar-CONTEXT information
authorMartin Fuchs <fuchs.martin@gmail.com>
Sun, 23 Nov 2003 20:00:43 +0000 (20:00 +0000)
committerMartin Fuchs <fuchs.martin@gmail.com>
Sun, 23 Nov 2003 20:00:43 +0000 (20:00 +0000)
svn path=/trunk/; revision=6768

reactos/subsys/system/explorer/taskbar/quicklaunch.cpp
reactos/subsys/system/explorer/utility/utility.h

index 32b0381..0c30fb5 100644 (file)
@@ -51,6 +51,8 @@ QuickLaunchMap::~QuickLaunchMap()
 QuickLaunchBar::QuickLaunchBar(HWND hwnd)
  :     super(hwnd)
 {
+       CONTEXT("QuickLaunchBar::QuickLaunchBar()");
+
        _dir = NULL;
 
        _next_id = IDC_FIRST_QUICK_ID;
@@ -70,6 +72,8 @@ QuickLaunchBar::~QuickLaunchBar()
 
 HWND QuickLaunchBar::Create(HWND hwndParent)
 {
+       CONTEXT("QuickLaunchBar::Create()");
+
        ClientRect clnt(hwndParent);
 
        HWND hwnd = CreateToolbarEx(hwndParent,
@@ -85,12 +89,14 @@ HWND QuickLaunchBar::Create(HWND hwndParent)
 
 void QuickLaunchBar::AddShortcuts()
 {
+       CONTEXT("QuickLaunchBar::AddShortcuts()");
+
        WaitCursor wait;
 
        try {
                TCHAR path[_MAX_PATH];
 
-               SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd);
+               SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd);     // perhaps also look into CSIDL_COMMON_APPDATA ?
 
                _stprintf(path, TEXT("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data);
 
@@ -157,6 +163,8 @@ LRESULT QuickLaunchBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
 
 int QuickLaunchBar::Command(int id, int code)
 {
+       CONTEXT("QuickLaunchBar::Command()");
+
        _entries[id]._entry->launch_entry(_hwnd);
 
        return 0;
index 5598918..9841a63 100644 (file)
@@ -578,7 +578,9 @@ struct ANS
        {
                int l = wcslen(s) + 1;
                _str = (LPSTR) malloc(2*l);
-               WideCharToMultiByte(CP_ACP, 0, s, -1, _str, 2*l, 0, 0);
+
+               if (WideCharToMultiByte(CP_ACP, 0, s, -1, _str, 2*l, 0, 0) <= 0)
+                       *_str = '\0';
        }
 
        ~ANS()
@@ -604,7 +606,9 @@ struct UNC
        {
                int l = strlen(s) + 1;
                _str = (LPWSTR) malloc(2*l);
-               MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l);
+
+               if (MultiByteToWideChar(CP_ACP, 0, s, -1, _str, l) <= 0)
+                       *_str = '\0';
        }
 
        ~UNC()