设为首页 加入收藏

TOP

子视窗控制项(二十一)
2010-12-30 21:12:42 来源: 作者: 【 】 浏览:32682
Tags:视窗 控制
nce, NULL) ;

ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;

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

void Triangle (HDC hdc, POINT pt[])
{
SelectObject (hdc, GetStockObject (BLACK_BRUSH)) ;
Polygon (hdc, pt, 3) ;
SelectObject (hdc, GetStockObject (WHITE_BRUSH)) ;
}

LRESULT CALLBACK WndProc ( HWND hwnd, UINT message, WPARAM wParam,LPARAM lParam)
{
static HWND hwndSmaller, hwndLarger ;
static int cxClient, cyClient, cxChar, cyChar ;
int cx, cy ;
LPDRAWITEMSTRUCT pdis ;
POINT pt[3] ;
RECT rc ;

switch (message)
{
case WM_CREATE :
cxChar = LOWORD (GetDialogBaseUnits ()) ;
cyChar = HIWORD (GetDialogBaseUnits ()) ;

// Create the owner-draw pushbuttons

hwndSmaller = CreateWindow (TEXT ("button"), TEXT (""),
WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
0, 0, BTN_WIDTH, BTN_HEIGHT,
hwnd, (HMENU) ID_SMALLER, hInst, NULL) ;

hwndLarger = CreateWindow (TEXT ("button"), TEXT (""),
WS_CHILD | WS_VISIBLE | BS_OWNERDRAW,
0, 0, BTN_WIDTH, BTN_HEIGHT,
hwnd, (HMENU) ID_LARGER, hInst, NULL) ;
return 0 ;

case WM_SIZE :
首页 上一页 18 19 20 21 22 23 24 下一页 尾页 21/61/61
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇功能表及其他资源 下一篇计时器

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: