设为首页 加入收藏

TOP

滑鼠(四十五)
2010-12-30 21:11:57 来源: 作者: 【 】 浏览:27861
Tags:滑鼠
NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}

LRESULT CALLBACK WndProc ( HWND hwnd, UINT message, WPARAM wParam,LPARAM lParam)
{
static int cxChar, cxCaps, cyChar, cxClient, cyClient, iMaxWidth ;
static int iDeltaPerLine, iAccumDelta ; // for mouse wheel logic
HDC hdc ;
int i, x, y, iVertPos, iHorzPos, iPaintBeg, iPaintEnd ;
PAINTSTRUCT ps ;
SCROLLINFO si ;
TCHAR szBuffer[10] ;
TEXTMETRIC tm ;
ULONG ulScrollLines ; // for mouse wheel logic
switch (message)
{
case WM_CREATE:
hdc = GetDC (hwnd) ;

GetTextMetrics (hdc, &tm) ;
cxChar = tm.tmAveCharWidth ;
cxCaps = (tm.tmPitchAndFamily & 1 3 : 2) * cxChar / 2 ;
cyChar = tm.tmHeight + tm.tmExternalLeading ;

ReleaseDC (hwnd, hdc) ;

// Save the width of the three columns

iMaxWidth = 40 * cxChar + 22 * cxCaps ;

// Fall through for mouse wheel information

case WM_SETTINGCHANGE:
SystemParametersInfo (SPI_GETWHEELSCROLLLINES, 0, &ulScrollLines, 0) ;

// ulScrollLines usually equals 3 or 0 (for no scrolling)
// WHEEL_DELTA equals 120, so iDeltaPerLine will be 40

if (
首页 上一页 42 43 44 45 46 47 48 下一页 尾页 45/50/50
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇计时器 下一篇键盘

评论

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