int s = 123; CString str; str.Format("%d",s); 这样就可以了,但是有的会提示这个错误 如果出现这个错误,就改成下面这个就OK了: str.Format(_T("%d"), s); http://liguo125.blog.51cto.com/1995200 Read More
posted @ 2016-02-05 22:38 findumars Views(321) Comments(0) Diggs(0)
Windows中,消息使用统一的结构体(MSG)来存放信息,其中message表明消息的具体的类型, 而wParam,lParam是其最灵活的两个变量,为不同的消息类型时,存放数据的含义也不一样。 time表示产生消息的时间,pt表示产生消息时鼠标的位置。 里面没有Result的选项。然后我用VC2 Read More
posted @ 2016-02-05 22:35 findumars Views(769) Comments(0) Diggs(0)
Delphi重定义消息结构随心所欲,只需要前4个字节是消息编号就行了,跟Windows消息虽然尽量保持一致,但其实相互没有特别大的关系。有了这个,就有了主动,带不带句柄完全看需要。 比如这个结构就带句柄(放到了第二个参数): 这个也带,因为确实需要: 这里甚至带了2个句柄: 而大多数消息都是不带句柄 Read More
posted @ 2016-02-05 21:43 findumars Views(369) Comments(0) Diggs(0)
LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, L Read More
posted @ 2016-02-05 21:37 findumars Views(647) Comments(0) Diggs(0)
程序本来是想实现鼠标单击改变背景颜色。可是,程序运行时,为什么没有任何消息触发,背景颜色就一直不断的改变了?WM_PAINT怎么被触发的 回答:这个基础,看一下《windows程序设计》第三章吧 wm_paint是有无效区域的时候产生的消息,所以应首先恢复该区域,才不会一直循环下去 wm_paint Read More
posted @ 2016-02-05 20:21 findumars Views(1420) Comments(0) Diggs(0)