PB's MousePtr seems to be overridden.

Started by David Kenny, March 13, 2006, 07:05:29 PM

Previous topic - Next topic

David Kenny

Added:
Paul, Could you move this to the Technical Assistance forum.  I forgot which one I was in when I selected new post.


I am trying to turn on the hourglass mouse icon in the Form_WM_Create function.  When my program is done initializing I will turn it back to a pointer.  It never changes.

If I create a new project. One Form, two Controls.  Here are the two bn_clicked routines:

Function FORM1_HRGLASS_BN_CLICKED (ControlIndex As Long, hWndForm As Dword, hWndControl As Dword, idButtonControl As Long) As Long
mouseptr 11
End Function

Function FORM1_NORMAL_BN_CLICKED (ControlIndex As Long, hWndForm As Dword, hWndControl As Dword, idButtonControl As Long) As Long
mouseptr 1
End Function

Mousepointer doesn't change when clicking the HRGLASS button.

I don't see anything in the FF documentation about Mouseptr.

Not worth slowing developement of FF 3 though.  Just thought I would ask in case I am doing something wrong.

David Kenny

Roger Garstang

Use the WM_SETCURSOR message.  Test whatever you need to and set cursor according to your specs, then make sure to Return TRUE so no message gets to the Default WinProc to change it back on you.

I'd use the CUSTOM function for your form, then use the lParam and wParam values to determine the buttons you want and change the cursor.  Or set a value Global/Static when buttons are clicked and check it in the message.  Use SetCursor API too, PB's mouse pointer functions never worked well for me.


Function FORM_CUSTOM (hWndForm As Dword, wMsg As Long, wParam As Dword, lParam As Long) As Long
  Select Case wMsg
     Case %WM_SETCURSOR
        If wParam= HWND_LinkButton Then
           SetCursor(LoadCursor(0, ByVal %IDC_HAND))
           Function= %TRUE
        End If
  End Select
End Function

David Kenny

Thanks Roger,

That should work just fine.

David