Yuav Ua Li Cas Tso Daim Ntawv Thov Ntawm Ib Daim Ntawv Thov

Cov txheej txheem:

Yuav Ua Li Cas Tso Daim Ntawv Thov Ntawm Ib Daim Ntawv Thov
Yuav Ua Li Cas Tso Daim Ntawv Thov Ntawm Ib Daim Ntawv Thov

Video: Yuav Ua Li Cas Tso Daim Ntawv Thov Ntawm Ib Daim Ntawv Thov

Video: Yuav Ua Li Cas Tso Daim Ntawv Thov Ntawm Ib Daim Ntawv Thov
Video: Yuav ua li cas thiaj thov tau daim ntawv tso cai los qhib business nyob rau lub nroog Minneapolis 2024, Hlis ntuj nqeg
Anonim

Thaum sau lwm cov kev pab cuam hauv C ++ hom lus programming, koj tuaj yeem ua ke ua haujlwm uas tso cai rau lwm cov ntawv thov khiav ntawm lub operating system ntawm tus kheej ntiag tug.

Yuav ua li cas tso daim ntawv thov ntawm ib daim ntawv thov
Yuav ua li cas tso daim ntawv thov ntawm ib daim ntawv thov

Cov Lus Qhia

Kauj ruam 1

Sau koj tus kheej cov yees duab sorting app. Txhawm rau ntxiv originality thiab ua haujlwm rau nws, koj tuaj yeem ntxiv hu rau lub graphical interface ncaj qha los ntawm cov program heev uas koj tau ua haujlwm. Muaj ob txoj haujlwm ntawm C ++ lus kom ua tiav cov haujlwm ntawd. Txuas lub windows.h thiab Shellapi.h cov tsev qiv ntawv kom tuaj yeem siv cov haujlwm ntawm kev tsim cov ntawv thov sab nraud ntawm lub operating system. Cov chaw qiv tau txuas nrog siv tus lej #include.

Kauj ruam 2

Siv lub ShellExecute () ua haujlwm yog tias koj xav tau kom dhau tsis dhau qhov kev thov hu ua. Kev ua haujlwm muaj qhov tsis xws li cov haujlwm: hwnd rau lub qhov rais cim, lpOperation qhia meej kev ua haujlwm rau daim ntawv thov hu ua (piv txwv, luam tawm lossis qhib), lpDirectory qhia qhov tseeb cov npe chaw npe, nShowCmd rau daim ntawv thov tso tawm hom, thiab lpParameters rau kev hla lwm cov tsis muaj xa mus rau npe thov.

Kauj ruam 3

Txhawm rau khiav cov haujlwm tshwj xeeb, siv WinExec () haujlwm. Ib txoj hlua parameter tau dhau mus rau qhov program code, uas qhia meej tag nrho txoj kev rau daim ntawv thov, nrog rau hom pib ua haujlwm ntawm daim ntawv thov no.

Kauj ruam 4

Cov ntawv hauv qab no tuaj yeem siv los ua piv txwv:

#ncig teb chaws

#ncig teb chaws

tsis muaj ntsiab ()

{

WinExec ("c: / windows / system32 / calc.exe", SW_SHOW);

}

Kauj ruam 5

Raws li kev coj ua cov kev cai no, lub Windows tshuab xam zauv zoo yuav qhib. Koj tuaj yeem piav qhia ntau yam teeb meem nyob rau hauv uas kev siv sab nraud ntawm lub operating system raug hu ua. Nco ntsoov suav nrog cov tsev qiv ntawv xav tau los ua haujlwm nrog cov haujlwm no.

Kauj Ruam 6

Sau cov ntawv teev npe txheem uas cov neeg siv yuav zoo los nruab. Khaws qhov no hauv siab yog tias koj tsis yog tib tug siv qhov program. Yog tias koj muaj teeb meem sau ib qho program, saib cov lus qhia tshwj xeeb video hauv Is Taws Nem.

Pom zoo: