win32 sdk右键菜单 —— 在小的实例也要分享,分享能加快我们的学习进程~
**** Hidden Message *****void RegisterWnd(LPCTSTR lpClassName)
{
WNDCLASSEX wce;
wce.style = CS_HREDRAW|CS_VREDRAW;
wce.lpfnWndProc = WndProc;
wce.cbSize = sizeof(WNDCLASSEX);
wce.cbClsExtra = 0;
wce.cbWndExtra = 0;
wce.hInstance = g_hInstance;
wce.hIcon= 0;
wce.hCursor = 0;
wce.hIconSm = 0;
wce.hbrBackground = HBRUSH(COLOR_BTNFACE);
wce.lpszClassName = lpClassName;
wce.lpszMenuName = 0;
if(!RegisterClassEx(&wce))
{
MessageBox(NULL,TEXT("注册失败"),TEXT("提示"),MB_OK);
}
}
HWND CreateWnd(LPCTSTR lpClassName)
{
HWND hWnd = CreateWindowEx(0,lpClassName,L"鱼C论坛",
WS_OVERLAPPED|WS_SYSMENU,300,200,
800,500,NULL,NULL,g_hInstance,NULL);
return hWnd;
}
void DisplayWnd(HWND hWnd)
{
ShowWindow(hWnd,SW_SHOW);
UpdateWindow(hWnd);
}
void Message()
{
MSG msg;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void NewConsole()
{
AllocConsole();
g_hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
}
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//NewConsole();
g_hInstance = hInstance;
RegisterWnd(L"拈花小仙");
HWND hWnd = CreateWnd(L"拈花小仙");
DisplayWnd(hWnd);
Message();
return 0;
}
{:7_145:}
小仙是菜鸟,但小仙敢发,因为我知道只有分享,我哪里写的不好才有人告诉我~
大神们都多我分享吧,荣耀感会加快你们的技术提升进程~
学习下 ,{:9_241:}谢谢分享
给力的帖子啊!!! 谢谢分享!!!! 向小仙学习 把不了妹买不了田 {:1_1:}
给力的帖子啊!!! 看看再说 繼續學習{:1_1:}
页:
[1]