设为首页 加入收藏

TOP

对话方块(四十三)
2010-12-30 21:13:56 来源: 作者: 【 】 浏览:40896
Tags:对话 方块

return msg.wParam ;
}

LRESULT CALLBACK WndProc ( HWND hwnd, UINT message, WPARAM wParam,LPARAM lParam)
{
switch (message)
{
case WM_DESTROY :
DeleteObject ((HGDIOBJ) SetClassLong (hwnd, GCL_HBRBACKGROUND,
(LONG) GetStockObject (WHITE_BRUSH))) ;
PostQuitMessage (0) ;
return 0 ;
}
return DefWindowProc (hwnd, message, wParam, lParam) ;
}

BOOL CALLBACK ColorScrDlg ( HWND hDlg, UINT message,WPARAM wParam, LPARAM lParam)
{
static int iColor[3] ;
HWND hwndParent, hCtrl ;
int iCtrlID, iIndex ;

switch (message)
{
case WM_INITDIALOG :
for (iCtrlID = 10 ; iCtrlID < 13 ; iCtrlID++)
{
hCtrl = GetDlgItem (hDlg, iCtrlID) ;
SetScrollRange (hCtrl, SB_CTL, 0, 255, FALSE) ;
SetScrollPos (hCtrl, SB_CTL, 0, FALSE) ;
}
return TRUE ;

case WM_VSCROLL :
hCtrl = (HWND) lParam ;
iCtrlID = GetWindowLong (hCtrl, GWL_ID) ;
iIndex = iCtrlID - 10 ;
hwndParent = GetParent (hDlg) ;

switch (LOWORD (wParam))
{
case SB_PAGEDOWN :
iColor[iIndex] += 15 ; // fall through
case SB_LINEDOWN :
iColor[iIndex] = min (255, iColor[iIndex] + 1) ;
break ;
case SB_PAGEUP :
iColor[iIndex] -= 15 ; /
首页 上一页 40 41 42 43 44 45 46 下一页 尾页 43/82/82
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇剪贴簿 下一篇功能表及其他资源

评论

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