I have tried tooltip feature in win32 code, when 'OK' clicked the message displays only when we hover on particular box. But the feature Iam expecting is auto display of message at particular box when 'OK' is clicked. Is it possible to add such feature of auto popup? I need some balloon type of error popup. My exact scenario is to error popup when Zero is given as input in a dialog, when 'OK' is clicked.
HWND gzui_controls::create_tool_tip_balloon(HWND hdlg, int tool_id, PTSTR text) const { if (!tool_id || !hdlg || !text) { return FALSE; }
HWND hwndTool = GetDlgItem(hdlg, tool_id);
if (WM_LBUTTONUP)
{
HWND hwndTip = CreateWindowEx(NULL, TOOLTIPS_CLASS, NULL,
WS_POPUP | SWP_NOMOVE | TTS_NOPREFIX | TTS_BALLOON | BS_PUSHBUTTON,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
hdlg, NULL,
getModuleInstance(), NULL);
if (!hwndTool || !hwndTip)
{
return (HWND)NULL;
}
// Associate the tooltip with the tool.
TOOLINFO toolInfo = { 0 };
toolInfo.cbSize = sizeof(toolInfo);
toolInfo.hwnd = hdlg;
toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
toolInfo.uId = (UINT_PTR)hwndTool;
toolInfo.lpszText = text;
SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo);
return hwndTip;
}