设为首页 加入收藏

TOP

功能表及其他资源(四)
2010-12-30 21:13:27 】 浏览:50740
Tags:功能 及其他 资源
d, iCmdShow) ;
UpdateWindow (hwnd) ;

while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}

LRESULT CALLBACK WndProc ( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HICON hIcon ;
static int cxIcon, cyIcon, cxClient, cyClient ;
HDC hdc ;
HINSTANCE hInstance ;
PAINTSTRUCT ps ;
int x, y ;

switch (message)
{
case WM_CREATE :
hInstance = ((LPCREATESTRUCT) lParam)->hInstance ;
hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON)) ;
cxIcon = GetSystemMetrics (SM_CXICON) ;
cyIcon = GetSystemMetrics (SM_CYICON) ;
return 0 ;

case WM_SIZE :
cxClient = LOWORD (lParam) ;
cyClient = HIWORD (lParam) ;
return 0 ;

case WM_PAINT :
hdc = BeginPaint (hwnd, &ps) ;

for (y = 0 ; y < cyClient ; y += cyIcon)
for (x = 0 ; x < cxClient ; x += cxIcon)
DrawIcon (hdc, x, y, hIcon) ;

EndPaint (hwnd, &ps) ;
return 0 ;

case WM_DESTROY :
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}

如果您试著编译该程式,因为在程式开头引用的RESOURCE.H档案并不存在,所以会产生错误。然而,您不必直接建立RESOURCE.H档案,而是

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 4/69/69
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇对话方块 下一篇子视窗控制项

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目