ReactOS  0.4.13-dev-100-gc8611ae
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 }
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
VOID OnRemoveStartmenuItems(HWND hDlg)
#define IDOK
Definition: winuser.h:824
#define IDC_CLASSICSTART_CLEAR
Definition: resource.h:145
#define _countof(array)
Definition: fontsub.cpp:30
#define CALLBACK
Definition: compat.h:27
#define IDC_CLASSICSTART_REMOVE
Definition: resource.h:142
UINT_PTR WPARAM
Definition: windef.h:207
int32_t INT_PTR
Definition: typedefs.h:62
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
struct _test_info info[]
Definition: SetCursorPos.c:19
#define CSIDL_RECENT
Definition: shlobj.h:2011
INT_PTR CALLBACK CustomizeClassicProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
VOID OnAdvancedStartMenuItems()
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
CHAR Message[80]
Definition: alive.c:5
static const WCHAR L[]
Definition: oid.c:1250
#define WM_COMMAND
Definition: winuser.h:1716
VOID OnClearRecentItems()
#define IDC_CLASSICSTART_ADVANCED
Definition: resource.h:143
#define SW_SHOWNORMAL
Definition: winuser.h:764
HINSTANCE hInst
Definition: dxdiag.c:13
VOID OnAddStartMenuItems(HWND hDlg)
LPCWSTR szPath
Definition: env.c:35
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2085
#define CSIDL_STARTMENU
Definition: shlobj.h:2014
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2236
VOID ShowCustomizeClassic(HINSTANCE hInst, HWND hExplorer)
#define IDC_CLASSICSTART_ADD
Definition: resource.h:141
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDCANCEL
Definition: winuser.h:825
#define CSIDL_PROGRAMS
Definition: shlobj.h:2005
#define IDD_CLASSICSTART_CUSTOMIZE
Definition: resource.h:87
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502