资源简介
USB键盘类 C 读写源码
代码片段和文件信息
// CScrollerCtrl : class implementation
// Copyright 2002 Joshua Heyer
// You are free to use this code for whatever you want provided you
// give credit where credit is due: if you use this code without substantial
// modification please presearve this comment block.
// I‘m providing this code in the hope that it is useful to someone as i have
// gotten much use out of other peoples code over the years.
// If you see value in it make some improvements etc. i would appreciate it
// if you sent me some feedback.
// Have fun!
//
#include “stdafx.h“
#include “ScrollerCtrl.h“
// command messages:
// sent when text has scrolled completely off the window
const int CScrollerCtrl::SC_SCROLL_COMPLETE = 0;
// defaults
const int CScrollerCtrl::nSCROLL_DELAY = 80; // time between each frame (milliseconds)
const int CScrollerCtrl::nSCROLL_PAUSE = 5000; // time to pause before autoscrolling (milliseconds)
const int CScrollerCtrl::nMARGIN = 5; // (pixels)
const int CScrollerCtrl::nFONT_SIZE = 12; // (points)
const int CScrollerCtrl::nFONT_WEIGHT = FW_SEMIBOLD;
const char* CScrollerCtrl::szFONT_NAME = “Comic Sans MS“;
// initialization
CScrollerCtrl::CScrollerCtrl()
{
m_crBackground = RGB(000);
m_crForeground = RGB(255255255);
m_pbmpPattern = NULL;
m_pbmpLogo = NULL;
m_nContentHeight = 0;
m_nScrollOffset = 0;
m_unTimerPause = 2;
m_nScrollDelay = nSCROLL_DELAY;
m_nScrollPause = nSCROLL_PAUSE;
m_eState = PAUSED;
m_bTilePattern = TRUE;
m_bShowScroll = FALSE;
m_bWrap = TRUE;
m_sizeBuffer = CSize(00);
}
// create the window:
// remove WS_VSCROLL to avoid showing scrollbar.
// remove WS_TABSTOP to disable keyboard scrolling.
BOOL CScrollerCtrl::Create(const RECT& rect CWnd* pParentWnd UINT ustyle UINT nID)
{
if ( NULL == m_font.GetSafeHandle() )
SetFont(szFONT_NAME nFONT_SIZE nFONT_WEIGHT);
// remember if user specified the style but don‘t show initially
m_bShowScroll = ustyle&WS_VSCROLL;
ustyle &= ~WS_VSCROLL;
if ( CWnd::Create(::AfxRegisterWndClass(CS_HREDRAW|CS_PARENTDC|CS_VREDRAW::LoadCursor(NULLIDC_ARROW)) “Scroller“ ustyle rect pParentWnd nID) )
{
m_eState = PAUSED;
SetTimer(1 m_nScrollDelay NULL);
m_unTimerPause = SetTimer(m_unTimerPause m_nScrollPause NULL);
return TRUE;
}
return FALSE;
}
// activate/deactivate wrapping mode:
// if not set content is scrolled completely off screen
// before being repeated.
void CScrollerCtrl::SetWrapping(BOOL bWrap)
{
m_bWrap = bWrap;
if ( NULL != m_hWnd )
Invalidate(FALSE);
}
// Sets the color used for the background (if no pattern is set)
// or margins (if pattern is set and not tiled)
void CScrollerCtrl::SetBgColor(COLORREF clrBg)
{
m_crBackground = clrBg;
if ( NULL != m_hWnd )
Invalidate(FALSE);
}
// Sets the
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-05-01 14:55 VC6_USB_Demo\
目录 0 2020-04-29 17:16 VC6_USB_Demo\Debug\
文件 41177 2020-04-27 11:50 VC6_USB_Demo\Debug\ScrollerCtrl.obj
文件 0 2020-04-27 11:50 VC6_USB_Demo\Debug\ScrollerCtrl.sbr
文件 124670 2020-04-27 11:50 VC6_USB_Demo\Debug\StdAfx.obj
文件 1494338 2020-04-27 11:50 VC6_USB_Demo\Debug\StdAfx.sbr
文件 3449856 2020-04-29 17:16 VC6_USB_Demo\Debug\testUSB.bsc
文件 131143 2020-04-29 17:16 VC6_USB_Demo\Debug\testUSB.exe
文件 305296 2020-04-29 17:16 VC6_USB_Demo\Debug\testUSB.ilk
文件 14196 2020-04-27 11:50 VC6_USB_Demo\Debug\testUSB.obj
文件 7637316 2020-04-27 11:50 VC6_USB_Demo\Debug\testUSB.pch
文件 500736 2020-04-29 17:16 VC6_USB_Demo\Debug\testUSB.pdb
文件 2088 2020-04-27 11:46 VC6_USB_Demo\Debug\testUSB.res
文件 0 2020-04-27 11:50 VC6_USB_Demo\Debug\testUSB.sbr
文件 74858 2020-04-29 17:16 VC6_USB_Demo\Debug\testUSBDlg.obj
文件 0 2020-04-29 17:16 VC6_USB_Demo\Debug\testUSBDlg.sbr
文件 377856 2020-05-01 14:55 VC6_USB_Demo\Debug\vc60.idb
文件 413696 2020-04-29 17:16 VC6_USB_Demo\Debug\vc60.pdb
文件 5197 2001-08-17 14:12 VC6_USB_Demo\devioctl.h
文件 12384 2001-08-17 12:39 VC6_USB_Demo\hid.lib
文件 80543 2001-08-17 14:12 VC6_USB_Demo\hidpi.h
文件 14555 2001-08-17 14:12 VC6_USB_Demo\hidsdi.h
文件 11028 2001-08-17 14:12 VC6_USB_Demo\hidusage.h
文件 3597 2004-10-28 18:55 VC6_USB_Demo\ReadMe.txt
目录 0 2020-03-26 14:38 VC6_USB_Demo\Release\
文件 36864 2004-10-31 21:47 VC6_USB_Demo\Release\testUSB.exe
目录 0 2020-03-26 14:38 VC6_USB_Demo\res\
文件 823 2004-10-28 22:34 VC6_USB_Demo\Resource.h
文件 766 2004-10-28 21:45 VC6_USB_Demo\res\testUSB.ico
文件 399 2004-10-28 18:55 VC6_USB_Demo\res\testUSB.rc2
文件 15767 2004-08-21 16:22 VC6_USB_Demo\ScrollerCtrl.cpp
............此处省略22个文件信息
相关资源
- 吕鑫vc6c++数据结构视频源码
- stm32f103 USB键盘
- 猜数字游戏.sb3
- MFC的异步网络通讯应用程序
- VC6查找与替换插件
- c++监控USB插拔状态源码
- UC/OS2 (UCOS2)移植于VC6代码及手册
- VC6.0 完整的图像处理程序 运用了大量
- VC6.0经典串口通信源程序C++
- VC6.0MFC界面美化
- 即时通讯开发源码终极版C#.NETC++都有
- win7风格的mfc界面美化源代码
- VS打开VC6.0所需libcd.lib
- MFC画圆自定义|位置|半径|边界和内部
- USB识别 HID识别 MFC代码
- 用vc++6.0实现的银行账户管理系统
- vc6.0编程助手Visual_AssistX(含破解补丁
- VC6.0_MFC画图demo小程序源码
- USB 完整bootloader项目,包括底层驱动和
- Visual_assist_X_for_VC6.0破解版.rar
- C++&easyx;的坦克大战
- VC开发MFC局域网屏幕监控系统完美版
- VC6.0三维画图画三维球,立方体,矩形
- USB2.0接口数据采集卡
- 基于VC MFC的数据分析系统
- VC6中使用MFC自动化Excel数据写入和图表
- MFC 下写的SVM类
- VC6.0获取MAC地址
- VC6运行库全版
- vc6.0+opengl纯色五角星填充
评论
共有 条评论