-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPather.cpp
More file actions
28 lines (23 loc) · 853 Bytes
/
Pather.cpp
File metadata and controls
28 lines (23 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <string>
#include "Registry.h"
#include "Path.h"
using namespace std;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int cmdShow) {
string targetDir = string(lpCmdLine);
Registry reg;
Path path(reg.getPath());
// If the string is in the path, prompt to remove it
if (path.contains(targetDir)) {
int remove = MessageBox(NULL, "That directory is already in your path, would you like to remove it?",
"That directory is already in your path!",
MB_YESNO);
if (remove == IDYES) {
path.remove(targetDir);
//reg.savePath(path.get());
}
return 0;
}
path.add(targetDir);
//reg.savePath(path.get());
return 0;
}