我最近写了个小程序,是有关加载光标的,功能要求如下:在点击工具栏上的一按钮后,在客户区内的鼠标光标变为我所加载的光标,我加载的程序如下:
HANDLE m_hcurRubber;
m_hcurRubber = AfxGetApp()->LoadCursor(IDC_CURSOR_ORBIT);
BOOL CXiajing2006View::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
CXiajing2006App *pApp=(CXiajing2006App *)AfxGetApp();
switch(pApp->Icon_kinds) {
case 50: ::SetCursor(m_hcurRubber);
break;
default:
break; }
return TRUE; return CView::OnSetCursor(pWnd, nHitTest, message);
}
在加载光标我以完成,但我想多实现一个功能,就是在按键盘ESC键后光标变为原来的箭头光标,还请各位能指点一下.谢谢!!!!!
HANDLE m_hcurRubber;
m_hcurRubber = AfxGetApp()->LoadCursor(IDC_CURSOR_ORBIT);
BOOL CXiajing2006View::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
CXiajing2006App *pApp=(CXiajing2006App *)AfxGetApp();
switch(pApp->Icon_kinds) {
case 50: ::SetCursor(m_hcurRubber);
break;
default:
break; }
return TRUE; return CView::OnSetCursor(pWnd, nHitTest, message);
}
在加载光标我以完成,但我想多实现一个功能,就是在按键盘ESC键后光标变为原来的箭头光标,还请各位能指点一下.谢谢!!!!!
解决方案 »
- 多线程问题,我编写串口的时候遇到的问题
- 求助!VC问题,我是菜鸟,高手来帮帮忙!
- delphi 程序 sendmessage(WM_COPYDATA)发到 win32 程序中接收时的问题,帮忙!!!
- 求助:VC中动态生成类的实例
- 怎样从将dll中的信息提取出来
- 一个让我头痛了好几天的问题(基于对话框的串口通信问题)50分送上!
- 急!!!那位能给我说说“换皮肤”的思路(象winamp那样),越细越好,给100分。
- 如何实现一个履历表式样的界面呢?
- 求教:vc++中能否用相应按键的方式自己停止所编写的死循环程序?
- 在哪儿可下载用GDI写的立体字的source code?
- 为何向【IE Browser】弹出的对话框中的按钮,发送单击消息不起作用?
- 无法为CListCtrl添加数据?
{
if(pMsg->message==WM_KEYDOWN)
if(pMsg->wparam==VK_ESCAPE)
if(pApp->Icon_kinds==50)
pApp->Icon_kinds=51;
.....}
BOOL CXiajing2006View::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
CXiajing2006App *pApp=(CXiajing2006App *)AfxGetApp();
switch(pApp->Icon_kinds) {
case 50: ::SetCursor(m_hcurRubber);
break;
case 51:
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); default:
break; }
return TRUE; return CView::OnSetCursor(pWnd, nHitTest, message);
}