2013年5月30日

Scroll2

摘要: #include <Windows.h>#include <stdio.h>#include "resource.h"//#include <afxwin.h>LRESULT CALLBACK MyWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ){... 阅读全文

posted @ 2013-05-30 12:47 奔跑吧,蜗牛! 阅读(153) 评论(0) 推荐(0) 编辑

Windows Scroll Note

摘要: 理解关键一iPaintBeg=max(0,iVertPos+ps.rcPaint.top/cyChar);iPaintEnd=min(iVertPos+ps.rcPaint.bottom/cyChar,LINENUMBERS-1);iVertPos是当前滚动条位置,那么开始绘制的地方就应该是滚动条所在的位置,对应到要显示的整个区域的位置也是这个iVertPos,后面的top可以去掉,因为显示区top等于0。绘制结束的地方应该是iVertPos加上绘制区的高度。这些都需要在显示屏后面的整个显示范围上看,以绘制区为尺度。理解关键二x=cxChar*(1-iHorzPos);y=cyChar*(i- 阅读全文

posted @ 2013-05-30 10:05 奔跑吧,蜗牛! 阅读(205) 评论(0) 推荐(0) 编辑

导航