MouseIcon Example VC++

This example sets a custom mouse pointer. The pointer will change when it is placed over the ImageEdit control.

void CImgEdit1Dlg::OnMouseIcon() 
{
    // Sets a custom mouse pointer -- pointer will change when
    // placed over the ImgEdit control
    
    //Sets the specific picture icon
    CPictureHolder pic1;

    //Create the icon
    pic1.CreateFromIcon(IDR_MAINFRAME);

    CPicture cpPicU(pic1.GetPictureDispatch());

    
    //Specifies the custom mouse pointer to be used
    //when the mouse moves over the control
    //The custom MousePointer must be set.

    ImgEdit1.SetMouseIcon(cpPicU);
    ImgEdit1.SetMousePointer(99);  // wiMPCustom // 99
}