Click here to Skip to main content
15,176,561 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton21-May-19 20:46
MemberMichael Hinton21-May-19 20:46 
QuestionRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
David Crow22-May-19 3:55
MemberDavid Crow22-May-19 3:55 
AnswerRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Victor Nijegorodov22-May-19 5:18
MemberVictor Nijegorodov22-May-19 5:18 
GeneralRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton23-May-19 8:12
MemberMichael Hinton23-May-19 8:12 
QuestionAdd tool tip to menu Pin
NoviceEx17-May-19 2:28
MemberNoviceEx17-May-19 2:28 
AnswerRe: Add tool tip to menu Pin
Richard MacCutchan17-May-19 4:30
mveRichard MacCutchan17-May-19 4:30 
SuggestionRe: Add tool tip to menu Pin
David Crow17-May-19 4:38
MemberDavid Crow17-May-19 4:38 
AnswerRe: Add tool tip to menu Pin
leon de boer17-May-19 5:30
Memberleon de boer17-May-19 5: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 1:57
MemberNoviceEx20-May-19 1:57 
GeneralRe: Add tool tip to menu Pin
phil.o20-May-19 2:04
mvephil.o20-May-19 2:04 
QuestionHow to associate a row selected by ListControl with a specified path and file Pin
tianzhili439915-May-19 4:52
Membertianzhili439915-May-19 4:52 
AnswerRe: How to associate a row selected by ListControl with a specified path and file Pin
Richard MacCutchan15-May-19 4:59
mveRichard MacCutchan15-May-19 4:59 
QuestionRe: How to associate a row selected by ListControl with a specified path and file Pin
David Crow15-May-19 7:57
MemberDavid Crow15-May-19 7:57 
AnswerRe: How to associate a row selected by ListControl with a specified path and file Pin
tianzhili439915-May-19 15:40
Membertianzhili439915-May-19 15:40 
SuggestionRe: How to associate a row selected by ListControl with a specified path and file Pin
David Crow15-May-19 17:28
MemberDavid Crow15-May-19 17:28 
GeneralRe: How to associate a row selected by ListControl with a specified path and file Pin
tianzhili439915-May-19 23:42
Membertianzhili439915-May-19 23:42 
GeneralRe: How to associate a row selected by ListControl with a specified path and file Pin
Richard MacCutchan16-May-19 0:32
mveRichard MacCutchan16-May-19 0:32 
GeneralRe: How to associate a row selected by ListControl with a specified path and file Pin
tianzhili439916-May-19 1:06
Membertianzhili439916-May-19 1:06 
Questionsolved Linking "foreign" library - not build on running system ? Pin
Vaclav_12-May-19 18:46
MemberVaclav_12-May-19 18:46 
AnswerRe: Linking "foreign" library - not build on running system ? Pin
Richard MacCutchan12-May-19 22:19
mveRichard MacCutchan12-May-19 22:19 
QuestionC++, java Pin
Benjamin Apire9-May-19 11:47
MemberBenjamin Apire9-May-19 11:47 
QuestionRe: C++, java Pin
David Crow9-May-19 18:10
MemberDavid Crow9-May-19 18:10 
AnswerRe: C++, java Pin
CPallini9-May-19 22:22
mveCPallini9-May-19 22:22 
AnswerRe: C++, java Pin
Richard MacCutchan9-May-19 22:38
mveRichard MacCutchan9-May-19 22:38 
QuestionAnalyzing make error output - one problem solved.... Pin
Vaclav_8-May-19 7:38
MemberVaclav_8-May-19 7: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.