資源簡介
純C語言 + Win32 AP 一步一步寫個圍棋程序 字符串資源

代碼片段和文件信息
#include?
#include?“Resource.h“
/*??Declare?Windows?procedure??*/
LRESULT?CALLBACK?WinProc(HWND?UINT?WPARAM?LPARAM);
HINSTANCE?g_hInstance;
/*??Make?the?title?text?into?a?global?variable??*/
char?g_sztitleText[MAX_PATH];
int?WINAPI?WinMain?(HINSTANCE?hThisInstance?HINSTANCE?hPrevInstance
????????????????????LPSTR?lpszArgument?int?nCmdShow)
{
????char?szClassName[MAX_PATH];
????HWND?hwnd;???????????????/*?This?is?the?handle?for?our?window?*/
????MSG?messages;????????????/*?Here?messages?to?the?application?are?saved?*/
????WNDCLASSEX?wincl;????????/*?Data?structure?for?the?windowclass?*/
????/*?The?Window?structure?*/
????wincl.hInstance?=?hThisInstance;
????LoadString(g_hInstance?IDS_MAINCLASSNAME?szClassName?sizeof(szClassName));
????wincl.lpszClassName?=?szClassName;
????wincl.lpfnWndProc?=?WinProc;????????/*?This?function?is?called?by?windows?*/
????wincl.style?=?CS_DBLCLKS;???????????/*?Catch?double-clicks?*/
????wincl.cbSize?=?sizeof?(WNDCLASSEX);
????/*?Use?default?icon?and?mouse-pointer?*/
????wincl.hIcon?=?LoadIcon?(NULL?IDI_APPLICATION);
????wincl.hIconSm?=?LoadIcon?(NULL?IDI_APPLICATION);
????wincl.hCursor?=?LoadCursor?(NULL?IDC_ARROW);
????wincl.lpszMenuName?=?NULL;???????/*?No?menu?*/
????wincl.cbClsExtra?=?0;????????????/*?No?extra?bytes?after?the?window?class?*/
????wincl.cbWndExtra?=?0;????????????/*?structure?or?the?window?instance?*/
????/*?Use?Windows‘s?default?colour?as?the?background?of?the?window?*/
????wincl.hbrBackground?=?(HBRUSH)?COLOR_BACKGROUND;
????/*?Register?the?window?class?and?if?it?fails?quit?the?program?*/
????if?(!RegisterClassEx?(&wincl))
????????return?0;
????LoadString(g_hInstance?IDS_MAINCAPTION?g_sztitleText?sizeof(g_sztitleText));
????/*?The?class?is?registered?let‘s?create?the?program*/
????hwnd?=?CreateWindowEx?(
???????????0???????????????????/*?Extended?possibilites?for?variation?*/
???????????szClassName?????????/*?Classname?*/
???????????g_sztitleText???????/*?title?Text?*/
???????????WS_OVERLAPPEDWINDOW?/*?default?window?*/
???????????CW_USEDEFAULT???????/*?Windows?decides?the?position?*/
???????????CW_USEDEFAULT???????/*?where?the?window?ends?up?on?the?screen?*/
???????????544?????????????????/*?The?programs?width?*/
???????????375?????????????????/*?and?height?in?pixels?*/
???????????HWND_DESKTOP????????/*?The?window?is?a?child-window?to?desktop?*/
???????????NULL????????????????/*?No?menu?*/
???????????hThisInstance???????/*?Program?Instance?handler?*/
???????????NULL?????????????????/*?No?Window?Creation?data?*/
???????????);
????/*?Make?the?window?visible?on?the?screen?*/
????ShowWindow?(hwnd?nCmdShow);
????/*?Run?the?message?loop.?It?will?run?until?GetMessage()?returns?0?*/
????while?(GetMessage?(&messages?NULL?0?0))
????{
????????/*?Translate?virtual-key?messages?into?character?messages?*/
????????TranslateMessage(&messages);
????????/*?Send?message?to?WindowProcedure?*/
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3685??2012-08-26?13:07??TryHandTalk\main.cpp
?????文件????????179??2012-08-26?13:04??TryHandTalk\Resource.h
?????文件???????1257??2012-08-26?13:25??TryHandTalk\TryHandTalk.cbp
?????文件????????227??2012-08-26?13:18??TryHandTalk\TryHandTalk.depend
?????文件????????451??2012-08-26?13:25??TryHandTalk\TryHandTalk.layout
?????文件????????178??2012-08-26?13:04??TryHandTalk\TryHandTalk.rc
?????目錄??????????0??2012-08-26?13:25??TryHandTalk
-----------?---------??----------?-----??----
?????????????????5977????????????????????7
評論
共有 條評論