4 * Copyright 2006 - 2007 Thomas Weidenmueller <w3seek@reactos.org>
5 * 2015 Robert Naumann <gonzomdx@gmail.com>
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.
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.
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
24 VOID
OnAddStartmenuItems(HWND hDlg
)
26 WCHAR szPath
[MAX_PATH
];
28 if(SUCCEEDED(SHGetFolderPathW(NULL
, CSIDL_STARTMENU
, NULL
, 0, szPath
)))
30 WCHAR szCommand
[MAX_PATH
] = L
"appwiz.cpl,NewLinkHere ";
31 if(SUCCEEDED(StringCchCatW(szCommand
, MAX_PATH
, szPath
)))
32 ShellExecuteW(hDlg
, L
"open", L
"rundll32.exe", szCommand
, NULL
, SW_SHOWNORMAL
);
36 VOID
OnAdvancedStartMenuItems()
38 WCHAR szPath
[MAX_PATH
];
40 if(SUCCEEDED(SHGetFolderPathW(NULL
, CSIDL_STARTMENU
, NULL
, 0, szPath
)))
42 ShellExecuteW(NULL
, L
"explore", szPath
, NULL
, NULL
, SW_SHOWNORMAL
);
46 VOID
OnClearRecentItems()
48 WCHAR szPath
[MAX_PATH
], szFile
[MAX_PATH
];
52 if(SUCCEEDED(SHGetFolderPathW(NULL
, CSIDL_RECENT
, NULL
, 0, szPath
)))
54 StringCchPrintf(szFile
,MAX_PATH
, L
"%s\\*.*", szPath
);
55 hPath
= FindFirstFileW(szFile
, &info
);
58 StringCchPrintf(szFile
,MAX_PATH
, L
"%s\\%s", szPath
, info
.cFileName
);
61 }while(FindNextFileW(hPath
, &info
));
63 /* FIXME: Disable the button*/
67 INT_PTR CALLBACK
CustomizeClassicProc(HWND hwnd
, UINT Message
, WPARAM wParam
, LPARAM lParam
)
72 /* FIXME: Properly intialize the dialog (check whether 'clear' button must be disabled, for example) */
75 switch(LOWORD(wParam
))
77 case IDC_CLASSICSTART_ADD
:
78 OnAddStartmenuItems(hwnd
);
80 case IDC_CLASSICSTART_ADVANCED
:
81 OnAdvancedStartMenuItems();
83 case IDC_CLASSICSTART_CLEAR
:
87 EndDialog(hwnd
, IDOK
);
90 EndDialog(hwnd
, IDCANCEL
);
100 VOID
ShowCustomizeClassic(HINSTANCE hInst
, HWND hExplorer
)
102 DialogBox(hInst
, MAKEINTRESOURCE(IDD_CLASSICSTART_CUSTOMIZE
), hExplorer
, CustomizeClassicProc
);