//显示链接动态链接库 CString pszDllName="shell32.dll"; HINSTANCE hLib = ::LoadLibrary(pszDllName); char p[256]; // 定义pRunFileDlg为一人指定函数的指针,它的返回值为void类型 // 然后参数类型为 (HWND, LPCTSTR, UINT) typedef void (__stdcall *pRunFileDlg)(HWND, LPCTSTR, UINT); pRunFileDlg RunFileDlg; if (hLib==NULL) { return ; } // 从Dll中得到导出函数的地址并强制转换成定义的类型(59是导出函数的编号) RunFileDlg = (pRunFileDlg)GetProcAddress(hLib, (char *)59); CString name ="wolfbabyÖØÆô"; LPWSTR 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); // 运行文件对话框(注释同上) CString pszDllName="shell32.dll"; HINSTANCE hLib = ::LoadLibrary(pszDllName); typedef void (__stdcall *pRunFileDlg)(HWND, HICON, LPCTSTR, LPCTSTR, LPCTSTR, UINT); pRunFileDlg RunFileDlg; Fuck pa; pa(1,2,3); 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,0 x02); } ::FreeLibra
得到Windows的运行文件与重新启动对话框
最新推荐文章于 2024-08-22 17:56:09 发布