void COutRunDlgDlg::OnRun()
{
CString pszDllName="shell32.dll";
HINSTANCE hLib = ::LoadLibrary(pszDllName);
typedef void (__stdcall *pRunFileDlg)(HWND, HICON, LPCTSTR, LPCTSTR, LPCTSTR, UINT);
pRunFileDlg RunFileDlg;
if (hLib==NULL)
{
return ;
}
RunFileDlg = (pRunFileDlg)GetProcAddress(hLib, (char *)61);
CString name ="wolfbaby的運行";
CString sss = "輸入程式路徑";
LPWSTR wname=new WCHAR[100];
LPWSTR wsss=new WCHAR[100];
memset(wname,0,sizeof(WCHAR)*100);
memset(wsss,0,sizeof(WCHAR)*100);
MultiByteToWideChar(CP_ACP,
MB_PRECOMPOSED, // character-type options
name, // address of string to map
name.GetLength(), // number of bytes in string
wname, // address of wide-character buffer
100
);
MultiByteToWideChar(CP_ACP,
MB_PRECOMPOSED, // character-type options
sss, // address of string to map
sss.GetLength(), // number of bytes in string
wsss, // address of wide-character buffer
100
);
if(RunFileDlg!=NULL)
{
RunFileDlg(this->GetSafeHwnd(),NULL,NULL,(LPCTSTR)wname,(LPCTSTR)wsss,0x02);
}
::FreeLibrary(hLib);
delete []wname;
delete []wsss;
}
void COutRunDlgDlg::OnRestar()
{
CString pszDllName="shell32.dll";
HINSTANCE hLib = ::LoadLibrary(pszDllName);
typedef void (__stdcall *pRunFileDlg)(HWND, LPCTSTR, UINT);
pRunFileDlg RunFileDlg;
if (hLib==NULL)
{
return ;
}
RunFileDlg = (pRunFileDlg)GetProcAddress(hLib, (char *)59);
CString name ="wolfbaby重啟";
wchar_t *wname=new WCHAR[100];
memset(wname,0,sizeof(WCHAR)*100);
MultiByteToWideChar(CP_ACP,
MB_PRECOMPOSED, // character-type options
name, // address of string to map
name.GetLength(), // number of bytes in string
wname, // address of wide-character buffer
100
);
if(RunFileDlg!=NULL)
{
RunFileDlg(this->GetSafeHwnd(),(LPCTSTR)wname,0x02);
}
::FreeLibrary(hLib);
delete []wname;
}