例子:MOD格式音频文件播放
优质
小牛编辑
138浏览
2023-12-01
引用脚本的内容:
SetCompressor /SOLID lzma XPStyle on Name "Test" OutFile "Test.exe" Caption "Test安装向导" BrandingText 'Test' Var count SetFont /LANG=2052 "tahoma" 8 !include "UseFulLib.nsh" !include "MUI.nsh" InstallDir "$EXEDIR" !define MUI_ABORTWARNING !define MUI_CUSTOMFUNCTION_GUIINIT MyGUIInit ;创建关于相关链接 !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_LANGUAGE "SimpChinese" Section "BOO" SectionEnd Function MyGUIInit Push `;` System::Call 'User32::CreateWindowEx(i,t,t,i,i,i,i,i,i,i,i,v) i (0,"button",s,0x54000000,i 10,i 327,i 24,i 24,$HWNDPARENT,1199,s,0) .s' Exch $R0 Push $R1 CreateFont $R1 "webdings" 11 1500 SetCtlColors $R1 0xFF0080 transparent SendMessage $R0 ${WM_SETFONT} $R1 0 GetFunctionAddress $R2 Link1 ButtonLinker::AddEventHandler /NOUNLOAD 1199 $R2 FunctionEnd Function Link1 GetDlgItem $R2 $HWNDPARENT 1199 IntOp $count $count ! StrCmp $count 1 +1 +4 System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicPause()' SendMessage $R2 ${WM_SETTEXT} 0 "STR:4" Goto +3 System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicPlay()' SendMessage $R2 ${WM_SETTEXT} 0 "STR:;" FunctionEnd Function .onInit InitPluginsDir StrCpy $count 0 File /oname=$PLUGINSDIR\BASSMOD.dll BASSMOD.dll File /oname=$PLUGINSDIR\mymusic.mod mymusic.mod StrCpy $R1 "$PLUGINSDIR\mymusic.mod" System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_Init(i -1,i 44100,i 0)' System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicFree()' System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicLoad(i 0,t R1,i 0,i 0,i 4)' System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicPlay()' FunctionEnd Function .onGUIEnd System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicStop()' System::Call '$PLUGINSDIR\BASSMOD::BASSMOD_MusicFree()' FunctionEnd
点击另存附件。