#include #include int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance , LPSTR lpCmdLine, int cmdShow) { char buf[MAX_PATH + 5]; char Dirbuf[MAX_PATH + 5]; LPTSTR lplink; WIN32_FIND_DATA fd; int i = lstrlen(lpCmdLine); lstrcpy(Dirbuf, lpCmdLine); for(int n=i ; n>0 ; n--) { if(Dirbuf[n] == '\\') { Dirbuf[n] = '\0'; break; } } FindFirstFile(lpCmdLine, &fd); wsprintf(buf, "%s\\%s", Dirbuf, fd.cFileName); lplink = strstr(buf, "へのショートカット.lnk"); if(lplink == NULL) return 0; lstrcpy(lplink, ".lnk"); MoveFile(lpCmdLine, buf); return 0; }