深入淺出shellexecute
譯者:徐景周(原作:nishant s)
q: 如何開啟乙個應用程式?
shellexecute(this->m_hwnd,"open","calc.exe","","", sw_show );或
shellexecute(this->m_hwnd,"open","notepad.exe",正如您所看到的,我並沒有傳遞程式的完整路徑。"c:","",sw_show );
q: 如何開啟乙個同系統程式相關連的文件?
shellexecute(this->m_hwnd,"open",q: 如何開啟乙個網頁?"c:","","",sw_show );
shellexecute(this->m_hwnd,"open",q: 如何啟用相關程式,傳送email?"","","", sw_show );
shellexecute(this->m_hwnd,"open",q: 如何用系統查詢功能來查詢指定檔案?q: 如何用系統印表機列印文件?
shellexecute(this->m_hwnd,"print",
"c:","","", sw_hide);
shellexecute(m_hwnd,"find","d://nish",q: 如何啟動乙個程式,直到它執行結束?null,null,sw_show);
shellexecuteinfo shexecinfo = ;或:shexecinfo.cbsize = sizeof(shellexecuteinfo);
shexecinfo.fmask = see_mask_nocloseprocess;
shexecinfo.hwnd = null;
shexecinfo.lpverb = null;
shexecinfo.lpfile = "c:";
shexecinfo.lpparameters = "";
shexecinfo.lpdirectory = null;
shexecinfo.nshow = sw_show;
shellexecuteex(&shexecinfo);
waitforsingleobject(shexecinfo.hprocess,infinite);
process_information processinfo;q: 如何顯示檔案或資料夾的屬性?startupinfo startupinfo; //this is an [in] parameter
zeromemory(&startupinfo, sizeof(startupinfo));
startupinfo.cb = sizeof startupinfo ; //only compulsory field
if(createprocess("c://winnt", null,
null,null,false,0,null,
null,&startupinfo,&processinfo))
else
shellexecuteinfo shexecinfo =;shexecinfo.cbsize = sizeof(shellexecuteinfo);
shexecinfo.fmask = see_mask_invokeidlist ;
shexecinfo.hwnd = null;
shexecinfo.lpverb = "properties";
shexecinfo.lpfile = "c://"; //can be a file as well
shexecinfo.lpparameters = "";
shexecinfo.lpdirectory = null;
shexecinfo.nshow = sw_show;
shellexecuteex(&shexecinfo);
下面是我自己的**,呼叫word開啟doc或docx檔案
[c-sharp]view plaincopy
void
copenfiledlgdlg::onbnclickedbutton1()
} } }
VC呼叫其他程式以及用其他程式開啟相應檔案
深入淺出shellexecute 譯者 徐景周 原作 nishant s q 如何開啟乙個應用程式?shellexecute this m hwnd,open calc.exe sw show 或 shellexecute this m hwnd,open notepad.exe c sw show...
呼叫其他程式
1含有事務碼 1.1不注入引數,直接呼叫 call transaction suim and skip first screen.1.2注入引數,setparameter id 螢幕字段 field 填充的字段值,螢幕字段 field 填充的字段值.call transaction demo tra...
android 呼叫其他程式
第一種 packagemanager pm this.getpackagemanager private void getintent packagemanager packagemanager,string path catch namenotfoundexception e 第二種 知道其他程式...