Advertisement
elvman

Untitled

Jun 30th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. HWND CreateToolTip(int toolID, HWND window, PTSTR pszText)
  2. {
  3. // Create the tooltip. g_hInst is the global instance handle.
  4. HWND hwndTip = CreateWindowEx(NULL, TOOLTIPS_CLASS, NULL,
  5. WS_POPUP |TTS_ALWAYSTIP | TTS_BALLOON,
  6. CW_USEDEFAULT, CW_USEDEFAULT,
  7. CW_USEDEFAULT, CW_USEDEFAULT,
  8. hDlg, NULL,
  9. g_hInst, NULL);
  10.  
  11. if (!hwndTip)
  12. {
  13. return (HWND)NULL;
  14. }
  15.  
  16. // Associate the tooltip with the tool.
  17. TOOLINFO toolInfo = { 0 };
  18. toolInfo.cbSize = sizeof(toolInfo);
  19. toolInfo.hwnd = hDlg;
  20. toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
  21. toolInfo.uId = (UINT_PTR)hwndTool;
  22. toolInfo.lpszText = pszText;
  23. SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo);
  24.  
  25. return hwndTip;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement