设为首页 加入收藏

TOP

滑鼠(三十三)
2010-12-30 21:11:57 来源: 作者: 【 】 浏览:27896
Tags:滑鼠
DIVISIONS ;
y = (y + DIVISIONS) % DIVISIONS ;

idFocus = y << 8 | x ;

SetFocus (GetDlgItem (hwnd, idFocus)) ;
return 0 ;

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

LRESULT CALLBACK ChildWndProc (HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;
RECT rect ;

switch (message)
{
case WM_CREATE :
SetWindowLong (hwnd, 0, 0) ; // on/off flag
return 0 ;

case WM_KEYDOWN:
// Send most key presses to the parent window

if (wParam != VK_RETURN && wParam != VK_SPACE)
{
SendMessage (GetParent (hwnd), message, wParam, lParam) ;
return 0 ;
}
// For Return and Space, fall through to toggle the square

case WM_LBUTTONDOWN :
SetWindowLong (hwnd, 0, 1 ^ GetWindowLong (hwnd, 0)) ;
SetFocus (hwnd) ;
InvalidateRect (hwnd, NULL, FALSE) ;
return 0 ;

// For focus messages, invalidate the window for repaint

case WM_SETFOCUS:
idFocus = GetWindowLong (hwnd, GWL_ID) ;

// Fall through

case WM_KILLFOCUS:
InvalidateRect (hwnd, NULL, TRUE) ;
return 0 ;

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

GetCl
首页 上一页 30 31 32 33 34 35 36 下一页 尾页 33/50/50
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇计时器 下一篇键盘

评论

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