#include <iostream>
#include <string>
#include <vector>
#include <windows.h>
#include <shlobj.h>
class Shortcut
{
public:
std::string name;
std::string path;
std::string icon;
};
class ShortcutManager
{
public:
ShortcutManager();
void select_icon();
void add_shortcut();
void start();
private:
std::vector<Shortcut> shortcuts;
std::string shortcut_folder;
std::string icon_path;
};
ShortcutManager::ShortcutManager() {
// Kısayolların bulunduğu klasör
char* appdata_path;
SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, NULL, &appdata_path);
this->shortcut_folder = std::string(appdata_path) + "\\MyShortcuts";
if (CreateDirectory(this->shortcut_folder.c_str(), NULL) || ERROR_ALREADY_EXISTS == GetLastError())
{
// Klasör başarıyla oluşturuldu veya zaten var
}
else
{
std::cerr << "Klasör oluşturma hatası" << std::endl;
exit(EXIT_FAILURE);
}
// Uygulama penceresi oluşturma
std::cout << "Kisayol Yoneticisi" << std::endl;
// Başlık
std::cout << "Kisayollarinizi asagidaki listeden goruntuleyebilirsiniz" << std::endl;
// Kısayol listesi
std::cout << "Kisayol Listesi:" << std::endl;
// Resim seçme butonu
std::cout << "Resim Sec" << std::endl;
// Kısayol adı ve yolu giriş kutuları
std::cout << "Kisayol Adi:" << std::endl;
// Kısayol ekleme butonu
std::cout << "Kisayol Yolu:" << std::endl;
// Uygulama başlatma butonu
std::cout << "Baslat" << std::endl;
}
void ShortcutManager::select_icon() {
// Resim seçme işlemi
OPENFILENAME ofn;
char szFile[MAX_PATH] = "";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.lpstrFilter = "ICO Files (*.ico)\0*.ico\0";
ofn.lpstrFile = szFile;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_FILEMUSTEXIST;
if (GetOpenFileName(&ofn) != FALSE)
{
this->icon_path = ofn.lpstrFile;
std::cout << "Secilen Resim: " << this->icon_path << std::endl;
}
else
{
std::cerr << "Resim secme hatasi" << std::endl;
}
}
void ShortcutManager::add_shortcut()
;