Still on the rant I added to the thread about Window Get ...
If I take the same code (bottom of this post), and add just two lines, I get what I want - the cursor to change to a horizontal shape when the cursor is over the label, then changes back to an arrow when the cursor moves away from the label.
With Function = 0, I read in Help that the message gets passed on to the default class window procedure for labels. In that case, the cursor seems to be returned to a standard arrow cursor. I didn't tell it to do that, so somewhere in the default window procedure the change was made.
But with Function = 1, not only does the cursor stay a "9" when over the label, but when the cursor is moved off the label and onto the dialog, the cursor returns to an arrow! Courtesy of the default class window procedure for dialogs?
So now I have to ask myself "What else does the default window procedure do? What things does it do that I want done, and what does it do that I don't want done?". I've not found a place in MSDN that tells me, so here I am again, learning stuff piece-meal!
The learning process works, it's just not very darned efficient! (although, I realize that lessons learned the hard way do stick better).
If I take the same code (bottom of this post), and add just two lines, I get what I want - the cursor to change to a horizontal shape when the cursor is over the label, then changes back to an arrow when the cursor moves away from the label.
Code:
MousePTR 9 Function = 1
But with Function = 1, not only does the cursor stay a "9" when over the label, but when the cursor is moved off the label and onto the dialog, the cursor returns to an arrow! Courtesy of the default class window procedure for dialogs?
So now I have to ask myself "What else does the default window procedure do? What things does it do that I want done, and what does it do that I don't want done?". I've not found a place in MSDN that tells me, so here I am again, learning stuff piece-meal!
The learning process works, it's just not very darned efficient! (although, I realize that lessons learned the hard way do stick better).
Code:
#Compile Exe #Dim All #Include "Win32api.inc" Global hDlg As Dword Function PBMain() Dialog New Pixels, 0, "My Dialog",,, 100,100, %WS_OverlappedWindow , To hDlg Dialog Set Icon hDlg, "face" Control Add TextBox, hDlg, 551, "Button", 10, 10, 50, 50 Control Add Label, hDlg, 200, "Button", 70, 10, 10, 60, %SS_Notify Control Set Color hDlg, 200, %White, %White Dialog Show Modal hdlg Call DlgProc() End Function ' Dialog Callback Function =============================================================== CallBack Function DlgProc() As Long 'Console message list Static iMsgCount& CPrint Str$(iMsgCount&)+ " " + WinMsg(Cb.Msg) Incr iMsgCount& 'Respond to messagess Static iCount& Dim Style As Long, iReturn As Long, hTemp As Dword, temp$ Select Case Cb.Msg Case %WM_SetCursor Incr iCount Window Get Id Cb.WParam To iReturn 'print: control id + handle of window under mouse + dialog handle CPrint "SetCursor: " & Str$(iReturn) & " " & Str$(Cb.WParam) & " " & Str$(hDlg) Select Case iReturn Case 200 CPrint Str$(iCount) + " H-setcursor" MousePtr 9 Function = 1 End Select End Select End Function Sub CPrint (SOut As String) 'Semen Matusovski's CPrint code: Static hConsole As Long, cWritten As Long If hConsole = 0 Then AllocConsole: hConsole = GetStdHandle(-11&) WriteConsole hConsole, ByCopy sOut + $CrLf, Len(sOut) + 2, cWritten, ByVal 0& End Sub
Comment