现有Cursor1.cur文件一个
我想用指定的鼠标指针文件替换一个窗体内现有鼠标指针。
(注:这个窗体可能是任意窗体,而不是我程序内的窗体)

解决方案 »

  1.   

    Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long用这个API,把窗体的句柄传进去
    参数说明:
     hwnd -----------  Long,欲为其取得信息的窗口的句柄  nIndex ---------  Long,请参考GetWindowLong函数的nIndex参数的说明  dwNewLong ------  Long,由nIndex指定的窗口信息的新值
      

  2.   

    '使用资源文件
    Set Form.MouseIcon = LoadResPicture("MOUSEICON", vbResCursor)
    Form.MousePointer = VBRUN.vbCustom'使用ImageList
    Public Property Get CurrentMousePoint() As IPictureDisp
        Set CurrentMousePoint = MainForm.imagelist1.ListImages(0).ExtractIcon
    End PropertySet Form.MouseIcon = CurrentMousePoint