Private Sub Command1_Click()
Open App.Path & "\temp.lnk" For Output As #1
Close #1 '以上两句在程序所在目录建立一个临时文件
Shell "Rundll32.exe AppWiz.Cpl,NewLinkHere "& App.Path & "\temp.lnk"
End Sub
先定义这样一个函数
extern "C" __declspec(dllexport) void __cdecl MyEntry(
HWND hwnd, // handle to owner window
HINSTANCE hinst, // instance handle for the DLL
LPTSTR lpCmdLine, // string the DLL will parse
int nCmdShow // show state
)
{
MessageBox(NULL,lpCmdLine,"",MB_OK);
}