![]() With this a shortcut named afile.lnk which points to C:\\somedirectory\\afile.exe will be created within the directory pointed to by the pathToLink parameter which has “The comment to this file” has it comment and Ctrl Alt A has it shortcut key. MAKEWORD( 0x41, HOTKEYF_ALT HOTKEYF_CONTROL), " -help") ![]() " C:/Users/somedirectory/Desktop", " The comment to this file", MAKEWORD( 0x41, HOTKEYF_ALT HOTKEYF_CONTROL), L " -help") Ĭsc.CreateLinkFileBase( " C:\\somedirectory\\afile.exe", L " C:/Users/somedirectory/Desktop", L " The comment to this file", Ih.CreateLinkFileBase( " C:\\somedirectory\\afile.exe", " C:\\a-non-existing-directory\\", " The Comment", MAKEWORD( 0x41, HOTKEYF_ALT HOTKEYF_CONTROL), " -help", TRUE) Ĭsc.CreateLinkFileBase(L " C:\\somedirectory\\afile.exe", To force the creation of the destination directory if it doesn't exist Ih.CreateLinkFileBase( " C:\\somedirectory\\afile.exe", CSC_DESKTOP, " The Comment", MAKEWORD( 0x41, HOTKEYF_ALT HOTKEYF_CONTROL), " -help") Using with the newly introduced CSC_* constants - this example will create a shortcut on the current machine's desktop Add the two to your project and #include the CreateShortCut.h to your project These contains two files, a header file CreateShortCut.h and a source file “ CreateShortCut.cpp”. Grab the source code attached to this article. Shortcut creation is achieved in Win32 by the use of OLE COM IShellLink interface to create the shortcut and the IPersistFile interface to save it to disk (Persistent Storage). lnk extension which contains the location (path) to a referenced object and some other information needed to access and or describe the object. ![]() To a non-file base object (printer as a case study)Īn insight into Win32, OLE COM programming and C is essential 3.0 Creating the shortcut.To a file base object (local and network files, folders, drives, etc.).This article will show how to create a shortcut To see how to make an Internet Shortcut, read my article (tip) " A shortcut for your website". Please note, though several people have reported success in creating a shortcut that points to a URL (Internet Shortcut) using the techniques discussed in this article, however, this is not the ideal way to create an Internet Shortcut. Installers also use it to reference programs they installed from the desktop. which the shortcut is pointing to) from anywhere within the local system or network. ![]() ![]() It is used extensively for easy access to “referenced object” (object like file, folder, drive, printer, etc. Download CreateShortCut_19_07_2013.zip - 4.4 KBĪ shortcut or, in a programmer's jargon, a shell link is a very important object in the PC world. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |