In the app below, Window Get ID will not return the Control ID of a label unless I include the %ss_notify as a style for the label.
But Help says that %ss_notify will allow a label to receive %STN_CLICKED and %STN_DBLCLK notification messages. It doesn't say anything about needing %ss_notify for Window Get ID to work.
Does anyone know more about this? What else does %ss_notify enable, or disable (by its absence)?
And BTW, GetDlgCtrlID has the same result as Window Get ID - both require %ss_notify for the return value to be the control ID.
But Help says that %ss_notify will allow a label to receive %STN_CLICKED and %STN_DBLCLK notification messages. It doesn't say anything about needing %ss_notify for Window Get ID to work.
Does anyone know more about this? What else does %ss_notify enable, or disable (by its absence)?
And BTW, GetDlgCtrlID has the same result as Window Get ID - both require %ss_notify for the return value to be the control ID.
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" 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