ToolTip crash
BlitzMax Forums/MaxGUI Module/ToolTip crash
| ||
I had a random crash on ModifyGadgetItem (from a toolbar actually) the reason was the tooltip that failed (on windows 8.1) It does not always crash, it's just really random ... But once I patched the function, the problem never came back. > I fixed the problem by replacing the InsertListItem method from win32maxguiex.bmx with this : Type TWindowsToolbar Extends TWindowsGadget [...] Method InsertListItem(index,Text$,tip$,icon,tag:Object) Local but:TBBUTTON but=New TBBUTTON but.fsState=TBSTATE_ENABLED If icon = -2 Or (icon>-1 And _icons.IsBlankIcon(icon)) but.idCommand=0 but.fsStyle=TBSTYLE_SEP Else but.iBitmap=icon but.idCommand=index+1 but.fsStyle=TBSTYLE_BUTTON EndIf Desensitize() SendMessageW _hwnd,TB_INSERTBUTTON,index,Int Byte Ptr(but) Sensitize() If (tip<>Null) If (tip<>"") '[FIX WString Null] ' convert to WString Local l_tipWStr:Short ptr = tip.towstring(); ' assert it's not Null ! If l_tipWStr<>Null ' no empty string If l_tipWStr[0]<>0 Local ti:TOOLINFOW=New TOOLINFOW ti.cbSize=SizeOf(ti) ti.uFlags=TTF_SUBCLASS ti.hwnd=_hwnd ti.lpszText=l_tipWStr ti.uId=index+1 SendMessageW _hwnd,TB_GETITEMRECT,index,Int(Varptr ti.rect_left) SendMessageW _tooltips,TTM_ADDTOOLW,0,Int Byte Ptr(ti) MemFree ti.lpszText EndIf; EndIf; EndIf; EndIf EndMethod So, in the first time, there is probably something not really supported with windows 8.1, or maybe it's an issue for all windows version, whatever, am I wrong with this ? In the second time, if I'm right, would it be possible to update the maxgui current version with this hotfix ? (Not that it's hard to replace, but anytime I re-instal blitzmax, I use the "online" version) |