#ifdef _M_ARM #define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE 1 #endif #include #include #include #include #include "../notice/notice.h" int wmain (int argc, wchar_t **argv) { setlocale (LC_ALL, ""); std::wcout.imbue (std::locale ("", LC_CTYPE)); if (argc < 4 && argc > 1) { std::wcout << L"Error: invalid args." << std::endl; return 1; } else if (argc <= 1) { std::wcout << L"Usage: " << std::endl << L"\tshortcut.exe " << std::endl; return 0; } auto res = CreateShortcutWithAppIdW (argv [1], argv [2], argv [3]); if (SUCCEEDED (res.hr)) { std::wcout << L"Create successfully!" << std::endl; return 0; } else { std::wcout << L"Create failed. Reason: " << res.message << std::endl; return 1; } return 0; }