运行时改动CStatic的光标最简单的方法应该是什么?1。OnSetCursor;可行
2。SetCursor()为什么不行?既然不行,它是做什么用的?
3。如何查找MFC的源代码?
2。SetCursor()为什么不行?既然不行,它是做什么用的?
3。如何查找MFC的源代码?
解决方案 »
- 窗口中弹出菜单的显示
- 请教:如何写一段代码来产生一组满足正态分布的随机数?
- 关于socket编程中遇到的一个问题
- 在程序中怎么增加一个右键快捷菜单选项?
- 如何把输入edit中的字符串识别为公式,请给出大概思路,最好给点例子。谢谢!
- VC++中的project-- win32 Application,win32 console application是什么意思?
- 谁跟我解释一下这些东西:ostream,fstream,iostream,ifstream 有什么区别与联系?
- VC能否判断出系统开机完全进入桌面的时刻?
- IAccessible接口获取到QQ聊天窗口的输入控件,为什么用put_accvalue无法输入?感激不尽!
- 类的公有和私有成员函数的区别是什么?(请老兄们给小弟详细的讲讲)
- 声明了一个返回值为对象指针的member function,可是指针部分好象有问题
- 愤怒的军痞再次提问
hCursor = AfxGetApp() -> LoadCursor(IDC_CURSOR1);
SetCursor(hCursor);试试,绝对可行,我过的,效果很好
CStatic myStatic;// Create a child icon static control.
myStatic.Create(_T("my static"),
WS_CHILD|WS_VISIBLE|SS_ICON|SS_CENTERIMAGE, CRect(10,10,150,50),
pParentWnd);// Set the image of the static control to be the system arrow
// and small hourglass cursor.
myStatic.SetCursor( ::LoadCursor(NULL, IDC_APPSTARTING) );
设个断点,跟踪进去。(进不去就是没有吧)
{
HCURSOR hc;
UINT nID = m_IsVertical ? IDC_CUR_SPLVER : IDC_CUR_SPLHOR;
hc = AfxGetApp() ->LoadCursor(nID);
if(hc != NULL)
::SetCursor(hc);
return TRUE;
}就是不知道为什么。太郁闷!希望大家继续帮忙!
HCURSOR hCursor
);
Parameters
hCursor
[in] Handle to the cursor. The cursor must have been created by the CreateCursor or loaded by the LoadCursor or LoadImage function. If this parameter is NULL, the cursor is removed from the screen.
The width and height of the cursor must be the values returned by the GetSystemMetrics function for SM_CXCURSOR and SM_CYCURSOR. Return Values
The handle to the previous cursor indicates success. NULL indicates that there was no previous cursor.Res
Use Cursor.lib when targeting a platform that does not support mouse cursors. The only cursor this component library supports is the wait cursor. Use the following code to set the wait cursor.SetCursor(LoadCursor(NULL, IDC_WAIT));
Use Mcursor.lib when targeting a platform that does support mouse cursors. This library does not support color cursors.If SetCursor is called after CreateCursor creates a zero dimension cursor, it still shows the old cursor, not the new cursor.The cursor is set only if the new cursor is different from the previous cursor; otherwise, the function returns immediately. The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes control to another window. If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved. The cursor is not shown on the screen if the internal cursor display count is less than zero. This occurs if the application uses the ShowCursor function to hide the cursor more times than to show the cursor.