Click here to Skip to main content
14,212,594 members

C / C++ / MFC

 
AnswerRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton21-May-19 19:46
memberMichael Hinton21-May-19 19:46 
QuestionRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
David Crow22-May-19 2:55
memberDavid Crow22-May-19 2:55 
AnswerRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Victor Nijegorodov22-May-19 4:18
memberVictor Nijegorodov22-May-19 4:18 
GeneralRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton23-May-19 7:12
memberMichael Hinton23-May-19 7:12 
QuestionAdd tool tip to menu Pin
NoviceEx17-May-19 1:28
memberNoviceEx17-May-19 1:28 
AnswerRe: Add tool tip to menu Pin
Richard MacCutchan17-May-19 3:30
protectorRichard MacCutchan17-May-19 3:30 
SuggestionRe: Add tool tip to menu Pin
David Crow17-May-19 3:38
memberDavid Crow17-May-19 3:38 
AnswerRe: Add tool tip to menu Pin
leon de boer17-May-19 4:30
memberleon de boer17-May-19 4:30 
It's easy to add to any window using just the Windows API ..

So you have a window Handle (hWnd) and you have a char* tooltip you wish to display

First you must make sure commoncontrols is kicked

#include <commctrl.h>
#pragma comment(lib, "comctl32.lib")   // Shortcut to add library rather than manual add

INITCOMMONCONTROLSEX icex = {
	.dwSize = sizeof(INITCOMMONCONTROLSEX),
	.dwICC = ICC_STANDARD_CLASSES
};
InitCommonControlsEx(&icex);

Now create the tooltip window .. we will default to same area as window itself you can size it if you want
HWND TTWnd = CreateWindowEx (WS_EX_TOPMOST, TOOLTIPS_CLASS,	NULL, 
	WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON,
	CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
	hWnd, 0, 0, NULL); // Create tooltip window

if (TTWnd) // Tooltip window successfully created
{
	TOOLINFO ti = { 0 };
	SetWindowPos(TTWnd, HWND_TOPMOST, 0, 0, 0, 0,
		SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);  // Set window position
	ti.cbSize = sizeof(TOOLINFO); // Size of structure
	ti.uFlags = TTF_SUBCLASS; // Class
	ti.hwnd = hWnd;	// Parent window is YOUR HANDLE OF YOUR WINDOW
	ti.hinst = 0;	// This instance
	ti.uId = 0;	// No uid
	ti.lpszText = tooltip;	// YOUR TOOLTIP text pointer
	GetClientRect(hWnd, &ti.rect);	// Tooltip to cover whole window
	SendMessage(TTWnd, TTM_ADDTOOL, 0, (LPARAM)&ti); // Send message adding tooltip to window
}

Try it on any window you like Smile | :)
In vino veritas

AnswerRe: Add tool tip to menu Pin
NoviceEx20-May-19 0:57
memberNoviceEx20-May-19 0:57 
GeneralRe: Add tool tip to menu Pin
phil.o20-May-19 1:04
mvephil.o20-May-19 1:04 
QuestionHow to associate a row selected by ListControl with a specified path and file Pin
tianzhili439915-May-19 3:52
membertianzhili439915-May-19 3:52 
AnswerRe: How to associate a row selected by ListControl with a specified path and file Pin
Richard MacCutchan15-May-19 3:59
protectorRichard MacCutchan15-May-19 3:59 
QuestionRe: How to associate a row selected by ListControl with a specified path and file Pin
David Crow15-May-19 6:57
memberDavid Crow15-May-19 6:57 
AnswerRe: How to associate a row selected by ListControl with a specified path and file Pin
tianzhili439915-May-19 14:40
membertianzhili439915-May-19 14:40 
SuggestionRe: How to associate a row selected by ListControl with a specified path and file Pin
David Crow15-May-19 16:28
memberDavid Crow15-May-19 16:28 
GeneralRe: How to associate a row selected by ListControl with a specified path and file Pin
tianzhili439915-May-19 22:42
membertianzhili439915-May-19 22:42 
GeneralRe: How to associate a row selected by ListControl with a specified path and file Pin
Richard MacCutchan15-May-19 23:32
protectorRichard MacCutchan15-May-19 23:32 
GeneralRe: How to associate a row selected by ListControl with a specified path and file Pin
tianzhili439916-May-19 0:06
membertianzhili439916-May-19 0:06 
Questionsolved Linking "foreign" library - not build on running system ? Pin
Vaclav_12-May-19 17:46
memberVaclav_12-May-19 17:46 
AnswerRe: Linking "foreign" library - not build on running system ? Pin
Richard MacCutchan12-May-19 21:19
protectorRichard MacCutchan12-May-19 21:19 
QuestionC++, java Pin
Benjamin Apire9-May-19 10:47
memberBenjamin Apire9-May-19 10:47 
QuestionRe: C++, java Pin
David Crow9-May-19 17:10
memberDavid Crow9-May-19 17:10 
AnswerRe: C++, java Pin
CPallini9-May-19 21:22
mveCPallini9-May-19 21:22 
AnswerRe: C++, java Pin
Richard MacCutchan9-May-19 21:38
protectorRichard MacCutchan9-May-19 21:38 
QuestionAnalyzing make error output - one problem solved.... Pin
Vaclav_8-May-19 6:38
memberVaclav_8-May-19 6:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190619.2 | Last Updated 20 Jun 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid