win32姒傝堪

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了win32姒傝堪相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/getch' title='getch'>getch   incr   瀹炵幇   startup   缁熶竴   鏀鹃煶   main   瀹氫箟   鍋氫簡   

win32鍩轰簬宸叉湁鐨勬鏋?鏈夋剰鍏ュ彛鍑芥暟鍙湁涓€涓?/p>

閮介渶瑕佹湁涓€涓富鍑芥暟 鎵€鏈夌▼搴忕殑鍏ュ彛閮芥槸maincrtstartup

tydedef 椤惧悕鎬濅箟

window鏄熀浜巆,c++ 鍙堟兂鏈夎嚜宸辨墍鐗规湁鐨勬暟鎹被鍨?鎵€浠ュ湪C锛孋++鐨勭被鍨嬪熀纭€涓婂仛浜嗛噸瀹氫箟
1.鍖哄埆c璇█娌℃湁椤惧悕鎬濅箟
2.灏佽淇℃伅

鐗规€?锛?br />1.濡傛灉娌℃湁璁茶繃 鍏堣浆瀹氫箟鐪嬬被鍨?br />2.澶у啓H寮€澶?鍦╳in32閲岄潰璁插彞鏌?br />3.LP,P寮€澶村湪win32閲岄潰琛ㄧず鎸囬拡
4.windows閲岄潰鏁版嵁绫诲瀷鍏ㄩ兘鏄ぇ鍐?浣嗗悓鏃秝indows鏄熀浜嶤锛孋++鐨勬暟鎹被鍨?/p>

绋嬪簭涓袱绉嶅瓧绗﹂泦鐨勮〃鐜?澶氬瓧鑺傚拰瀹藉瓧鑺?浠ュ強閫氶厤瀛楃闆?/p>

window娌℃湁闊充箰鎾斁 鍙槸瀹夎浜嗕竴涓粯璁ょ殑闊充箰鎾斁鍣?/p>

瀛︿細杩愮敤windows缂栫▼ 缂栧啓鎾斁闊充箰

浠ヤ笂浠g爜濡備笅瀹炵幇

 1 //閫昏緫閮ㄥ垎 鏄惧紡閮ㄥ垎
 2 #include<Windows.h>
 3 #pragma comment(lib,"Winmm.lib")//搴撴枃浠?鍔ㄦ€佸簱鎴栭潤鎬佸簱
 4 //windows鐨勫叆鍙e嚱鏁?WinMain
 5 int WinMain(_In_ HINSTANCE hInstance,//搴旂敤绋嬪簭浣跨敤鍙ユ焺
 6     _In_opt_ HINSTANCE hPrevInstance,//鐖跺簲鐢ㄧ▼搴忓疄渚嬪彞鏌勶紙鐜扮増鏈负null锛?/span>
 7     _In_ LPSTR lpCmdLine,//鍛戒护琛屽弬鏁?/span>
 8     _In_ int nShowCmd)//绐楀彛鏄剧ず鏂瑰紡
 9 
10     MessageBoxA(nullptr,//绐楀彛鍙ユ焺
11         "abc",//娑堟伅鐩掑瓙鏂囨湰鍐呭
12         "123",//娑堟伅鐩掑瓙鏍囬
13         MB_YESNOCANCEL|MB_ICONWARNING//娑堟伅鐩掑瓙鐨勭被鍨?       
14         );
15     //windows鏄熀浜巆璇█c++鐨勫張鎯虫湁鑷繁鐨勬暟鎹被鍨?鎵€浠ュ湪c/c++鍩虹涓婂仛浜嗗啿瀹氫箟
16     //澶氬瓧鑺?/span>
17     char c = 鈥?/span>a鈥?/span>;
18     char *pc = "abc";//澶氬瓧鑺傚瓧绗︿覆
19         //pc = &c;
20         int m = strlen(pc);//澶氬瓧鑺傛眰闀垮害
21         //瀹藉瓧鑺?/span>
22         wchar_t wc = 鈥?/span>a鈥?/span>;//瀹藉瓧鑺傚瓧绗?/span>
23     wchar_t *pwc = L"ABCD";//瀹藉瓧鑺傚瓧绗︿覆
24     m = wcslen(pwc);//瀹藉瓧鑺傛眰闀垮害
25     //閫氶厤瀛楃闆嗚〃鐜?/span>
26     TCHAR tc = 鈥?/span>a鈥?/span>;//鍙互鏍规嵁鑷繁鐨勯渶姹傛敼鍙樺瓧鑺傜被鍨?/span>
27     TCHAR *ptc = _T("abc");//_T()甯﹀弬瀹?/span>
28     _tcslen(ptc);
29     //1.鍙互涓嶇椤圭洰涓娇鐢ㄧ殑瀛楃闆?鍙互鑷璁惧畾鍥哄畾鐨勭被鍨嬪幓琛ㄧ幇瀛楃鎴栬€呭瓧绗︿覆锛宑har鎴杦char_t
30     //2.鍙互缁熶竴浣跨敤瀛楃鐨勯€氶厤绫诲瀷
31     //wav闊充箰鎾斁
32     PlaySound(_T(""),//鏂囦欢璺緞鍚嶏紝鐩稿璺緞
33         nullptr,//搴旂敤绋嬪簭瀹炲垪鍙ユ焺
34         SND_LOOP | SND_FILENAME | SND_ASYNC//鏂囦欢鎿嶄綔妯″紡
35         //SND_LOOP 寰幆 SND_FILENAME 鎸囧畾鏂囦欢 SND_ASYNC 寮傛
36         );
37     //mp3闊充箰鎾斁
38     mciSendString(_T("....mp3 alias abc"),//鎵撳紑涓€涓?.mp3鐨勬枃浠?alias鍙栧埆鍚嶅彨abc
39         nullptr,//鎺ュ彈淇℃伅鐨勭紦瀛樺尯锛宯ull琛ㄧず涓嶆帴鍙椾俊鎭?/span>
40         0,//绗簩涓弬鏁扮殑鍐呭瓨澶у皬
41         nullptr);//鍥炶皟鍑芥暟鐨勭獥鍙e彞鏌?/span>
42     mciSendString(_T("play abc"), 0, 0, 0);
43     MessageBox(0, 0, 0, 0);//绫讳技浜巊etchar()鍥犱负windows缂栫▼閲屼笉鑳界敤
44 
45     return 0;
46 

 

以上是关于win32姒傝堪的主要内容,如果未能解决你的问题,请参考以下文章

钃濈墮SDP鍗忚姒傝堪

SpringCloud - 鍏ラ棬姒傝堪

鎺ュ彛娴嬭瘯 姒傝堪

绠楁硶鏁版嵁缁撴瀯01 /绠楁硶鏁版嵁缁撴瀯姒傝堪

webpack姒傝堪鈥斺€旇祫婧愩€佹牱寮忋€佸浘鐗囩殑鎵撳寘宸ュ叿

什么叫win32?