ReactOS 0.4.15-dev-6042-g2eb6700
startmnucust.cpp
Go to the documentation of this file.
1/*
2 * ReactOS Explorer
3 *
4 * Copyright 2006 - 2007 Thomas Weidenmueller <w3seek@reactos.org>
5 * 2015 Robert Naumann <gonzomdx@gmail.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include "precomp.h"
23
24// TODO: Windows Explorer appears to be calling NewLinkHere / ConfigStartMenu directly for both items.
26{
28
30 {
31 WCHAR szCommand[MAX_PATH] = L"appwiz.cpl,NewLinkHere ";
32 if (SUCCEEDED(StringCchCatW(szCommand, _countof(szCommand), szPath)))
33 ShellExecuteW(hDlg, L"open", L"rundll32.exe", szCommand, NULL, SW_SHOWNORMAL);
34 }
35}
36
38{
39 ShellExecuteW(hDlg, L"open", L"rundll32.exe", L"appwiz.cpl,ConfigStartMenu", NULL, SW_SHOWNORMAL);
40}
41
43{
45
47 {
49 }
50}
51
53{
54 WCHAR szPath[MAX_PATH], szFile[MAX_PATH];
56 HANDLE hPath;
57
59 {
60 StringCchPrintfW(szFile, _countof(szFile), L"%s\\*.*", szPath);
61 hPath = FindFirstFileW(szFile, &info);
62 do
63 {
64 StringCchPrintfW(szFile, _countof(szFile), L"%s\\%s", szPath, info.cFileName);
65 DeleteFileW(szFile);
66 }
67 while (FindNextFileW(hPath, &info));
68 FindClose(hPath);
69 /* FIXME: Disable the button*/
70 }
71}
72
74{
75 switch (Message)
76 {
77 case WM_INITDIALOG:
78 /* FIXME: Properly initialize the dialog (check whether 'clear' button must be disabled, for example) */
79 return TRUE;
80 case WM_COMMAND:
81 switch (LOWORD(wParam))
82 {
85 break;
88 break;
91 break;
94 break;
95 case IDOK:
97 break;
98 case IDCANCEL:
100 break;
101 }
102 break;
103 default:
104 return FALSE;
105 }
106 return TRUE;
107}
108
110{
112}
#define IDC_CLASSICSTART_ADVANCED
Definition: resource.h:145
#define IDC_CLASSICSTART_REMOVE
Definition: resource.h:144
#define IDC_CLASSICSTART_CLEAR
Definition: resource.h:147
#define IDC_CLASSICSTART_ADD
Definition: resource.h:143
#define IDD_CLASSICSTART_CUSTOMIZE
Definition: resource.h:87
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2558
static const WCHAR Message[]
Definition: register.c:74
HINSTANCE hInst
Definition: dxdiag.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:50
LPCWSTR szPath
Definition: env.c:37
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2346
#define CSIDL_RECENT
Definition: shlobj.h:2033
#define CSIDL_STARTMENU
Definition: shlobj.h:2036
#define CSIDL_PROGRAMS
Definition: shlobj.h:2027
#define _countof(array)
Definition: sndvol32.h:68
VOID OnRemoveStartmenuItems(HWND hDlg)
VOID OnAdvancedStartMenuItems()
VOID ShowCustomizeClassic(HINSTANCE hInst, HWND hExplorer)
VOID OnClearRecentItems()
INT_PTR CALLBACK CustomizeClassicProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
VOID OnAddStartMenuItems(HWND hDlg)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
int32_t INT_PTR
Definition: typedefs.h:64
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define IDCANCEL
Definition: winuser.h:825
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4389
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
#define IDOK
Definition: winuser.h:824
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180