grham Posted February 13, 2008 Share Posted February 13, 2008 (edited) Hi! I have discovered something "strange" (for me) while using (registering) a wm_notify function for two controls. Details: In my exemple it was for a rich text box and (then) a toolbar in another (child) window. When I put within the "switch hWndFrom" first the "case" of a toolbar and then the "case" for the RTB, the RTB doesn't send any message. In reversed order : first the "case" of the TRB and then the "case" of the toolbar, both of them send messages. So my solution was only to "reorder" the "case's" within the "switch hWndFrom" and that's it. Used with 3.2.10. an exemple of illustration (now correct!!!): Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tNMHDR, $event, $hwndFrom, $code, $i_idNew, $dwFlags, $lResult, $idFrom, $i_idOld Local $tNMTOOLBAR, $tNMTBHOTITEM $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hwndFrom = DllStructGetData($tNMHDR, "hWndFrom") $idFrom = DllStructGetData($tNMHDR, "IDFrom") $code = DllStructGetData($tNMHDR, "Code") Switch $hwndFrom Case $RichEdit Switch $code Case $EN_SELCHANGE Local $tSELCHANGE = DllStructCreate($tagSELCHANGE, $lParam) Local $cpMin = DllStructGetData($tSELCHANGE, 4) Local $cpMax = DllStructGetData($tSELCHANGE, 5) ConsoleWrite("Sel change:" & @LF & $cpMin & " --- " & $cpMax & @LF) EndSwitch Case $Typo_Toolbar, $Typo_Toolbar2 Switch $code Case $NM_LDOWN ;---------------------------------------------------------------------------------------------- $What_TB = $hWndFrom ConsoleWrite("$NM_LDOWN: Clicked Item: " & $iItem & " at index: " & _GUICtrlToolbar_CommandToIndex ($What_TB, $iItem) & @CRLF) ;---------------------------------------------------------------------------------------------- Case $TBN_HOTITEMCHANGE $tNMTBHOTITEM = DllStructCreate($tagNMTBHOTITEM, $lParam) $i_idOld = DllStructGetData($tNMTBHOTITEM, "idOld") $i_idNew = DllStructGetData($tNMTBHOTITEM, "idNew") $iItem = $i_idNew $dwFlags = DllStructGetData($tNMTBHOTITEM, "dwFlags") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc;==>_WM_NOTIFY ??? Maybe it has to be like this. Edited February 13, 2008 by grham Link to comment Share on other sites More sharing options...
Siao Posted February 13, 2008 Share Posted February 13, 2008 Read helpfile about Switch...Case...EndSwitch syntax. "be smart, drink your wine" Link to comment Share on other sites More sharing options...
GaryFrost Posted February 13, 2008 Share Posted February 13, 2008 What Siao is saying is: Case $Typo_Toolbar Or $Typo_Toolbar2oÝ÷ ÚÈhºW[y«¢+Ø ÍÀÌØíQåÁ½}Q½½±È°ÀÌØíQåÁ½}Q½½±È Because you used Switch SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
grham Posted February 13, 2008 Author Share Posted February 13, 2008 (edited) Ok I get it now. It was only a coincidence that it worked with "OR". When I put a coma, this behavior disapears. Thanks Siao and Gary And sorry (my fault) Edited February 13, 2008 by grham Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now