[求助]如何实现预览鼠标指针?
我想在窗口上放一个图片框,然后再放一些图象框在里面,让每个图象框都可以显示鼠标指针图像,用loadpicture无法读取指针格式的文件,也没有查到相关的api函数,请问这种效果怎样才能实现?用怎样的api函数?能否给个实例?[此贴子已经被作者于2007-8-29 12:10:56编辑过]
Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GCL_HCURSOR = (-12)
基本看懂了
先Load(filename) as long得到载入后的图标的句柄
然后用SetClassLong(hWnd,GCL_HCURSOR,那个句柄here)放进Picturebox之类的
最后不用的时候DestroyCursor
SetClassLong的解释可能不够准确
顺便提一句,destory的过去式和过去分词都是destroyed,不是destroied.
可是如何放进imagebox并让它显示出来呢?使用loadpicture吗?