在開始菜單文件夾創建文件夾,建快捷鍵

 /*-----------------------------------------------------------*/

*

* InstallShield Example Script

*

* Demonstrates the AddFolderIcon function.

*

* This example places a shortcut to an executable file on the

* Start menu and the Start Programs menu.

*

* Note: Before running this script, set the preprocessor

*       constants so that they reference the fully qualified

*       names of the Windows Notepad executable and a valid

*       text file on the target system.

*

/*-----------------------------------------------------------*/
#define PROGRAM TARGETDIR ^ "Notepad.exe"

#define PARAM   TARGETDIR ^ "回憶校園.txt"
function ExFn_AddFolderIcon(szName)

    STRING szProgramFolder, szItemName, szCommandLine, szWorkingDir;

    STRING szShortCutKey, szProgram, szParam, szIconPath;

    NUMBER nIcon;

begin


    // Set up parameters for call to AddFolderIcon.

    szProgramFolder = FOLDER_STARTMENU;

    szItemName      = "Notepad Example 1 " + szName;

    szProgram       = PROGRAM;

    szParam         = PARAM;


    LongPathToQuote (szProgram, TRUE);


    LongPathToShortPath (szParam);


    szCommandLine = szProgram + " " + szParam;

    szWorkingDir  =TARGETDIR;

    szIconPath    = "";

    nIcon         = 0;

    szShortCutKey = "";


    // Add a shortcut to the Start menu.

    if (AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir,

                      szIconPath, nIcon, szShortCutKey, REPLACE) < 0) then

        MessageBox ("AddFolderIcon failed.", SEVERE);

    else

        SprintfBox (INFORMATION, "AddFolderIcon", "%s created successfully.",

                   szItemName);

    endif;


    szProgramFolder = TEST;

    szItemName    = "Notepad Example 2 " + szName;


    // Add a shortcut to the Programs menu.

    if (AddFolderIcon (szProgramFolder, szItemName, szCommandLine, szWorkingDir,

                      szIconPath, nIcon, szShortCutKey, REPLACE) < 0) then

        MessageBox ("AddFolderIcon failed.", SEVERE);

    else

        SprintfBox (INFORMATION, "AddFolderIcon", "%s created successfully.",

                   szItemName);

    endif;


end;

 

使用

 ExFn_AddFolderIcon("Test2");

根據幫助的例子修改。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章