Click here to Skip to main content
16,005,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A Problem on Bitmap Pin
eli1502197918-Apr-05 23:40
eli1502197918-Apr-05 23:40 
GeneralRe: A Problem on Bitmap Pin
popo8419-Apr-05 5:01
popo8419-Apr-05 5:01 
GeneralRe: A Problem on Bitmap Pin
popo8419-Apr-05 5:01
popo8419-Apr-05 5:01 
GeneralRe: A Problem on Bitmap Pin
popo8419-Apr-05 5:15
popo8419-Apr-05 5:15 
GeneralGet data sent by POST method Pin
Anonymous18-Apr-05 22:52
Anonymous18-Apr-05 22:52 
GeneralTracking Tooltips Pin
RadiumBall18-Apr-05 22:40
RadiumBall18-Apr-05 22:40 
GeneralRe: Tracking Tooltips Pin
Shog919-Apr-05 7:14
sitebuilderShog919-Apr-05 7:14 
GeneralRe: Tracking Tooltips Pin
RadiumBall19-Apr-05 19:45
RadiumBall19-Apr-05 19:45 
Hello Thanks for the Reply,

Have you tried the code. If so please paste your function here, I would be very much greatful to you. As far as my try goes I do get a tracking rectangle follwing my mouse but it keeps blinking all the time I move the mouse and without the text I pasted in the code.


bool g_bIsVisible;
HWND g_hwndTT;


void CTestDlg::TooltipFunc()
{
INITCOMMONCONTROLSEX icex;
HWND hwndTT;
TOOLINFO ti;

// Load the tooltip class from the DLL.
icex.dwSize = sizeof(icex);
icex.dwICC = ICC_BAR_CLASSES;

if(!InitCommonControlsEx(&icex))
return NULL;

RECT rect;
GetClientRect (&rect);

// Create the tooltip control.
hwndTT = CreateWindow(TOOLTIPS_CLASS, TEXT(""),
WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, (HMENU)NULL, AfxGetApp()->m_hInstance,
NULL);

// Prepare TOOLINFO structure for use as tracking tooltip.
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
ti.hwnd = m_hWnd;
ti.uId = (UINT)m_hWnd;
ti.hinst = AfxGetApp()->m_hInstance;
ti.lpszText = "Hello World";
ti.rect.left = ti.rect.top = ti.rect.bottom = ti.rect.right = 0;

// Add the tool to the control, displaying an error if needed.
if(!::SendMessage(hwndTT,TTM_ADDTOOL,0,(LPARAM)&ti)){
MessageBox("Couldn't create the tooltip control.",
"Error",MB_OK);
return NULL;
}

// Activate (display) the tracking tooltip. Then, set a global
// flag value to indicate that the tooltip is active, so other
// functions can check to see if it's visible.
::SendMessage(hwndTT,TTM_TRACKACTIVATE,(WPARAM)TRUE,(LPARAM)&ti);

g_bIsVisible = TRUE;
g_hwndTT = hwndTT;
}

void CTestDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(g_bIsVisible){

#define X_OFFSET 15
#define Y_OFFSET X_OFFSET

POINT m_point;
::GetCursorPos(&m_point);
::SendMessage(g_hwndTT,
TTM_TRACKPOSITION,
0,
(LPARAM)MAKELPARAM(m_point.x + X_OFFSET,
m_point.y + Y_OFFSET));

}

CDialog::OnMouseMove(nFlags, point);
}


BOOL CTestDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
LPNMTTDISPINFO lpnmtdi = (LPNMTTDISPINFO) lParam;
strcpy (lpnmtdi->szText, "Hello World");
return CDialog::OnNotify(wParam, lParam, pResult);
}



Regards
Ashwin
GeneralProblm in Copy to ClipBoard Pin
zahid_ash18-Apr-05 21:57
zahid_ash18-Apr-05 21:57 
GeneralRe: Problm in Copy to ClipBoard Pin
mark novak19-Apr-05 0:14
mark novak19-Apr-05 0:14 
GeneralI occurs then too Pin
zahid_ash19-Apr-05 0:32
zahid_ash19-Apr-05 0:32 
GeneralRe: I occurs then too Pin
mark novak19-Apr-05 0:54
mark novak19-Apr-05 0:54 
GeneralRe: I occurs then too Pin
zahid_ash19-Apr-05 1:17
zahid_ash19-Apr-05 1:17 
GeneralRe: Problm in Copy to ClipBoard Pin
22491719-Apr-05 1:47
22491719-Apr-05 1:47 
GeneralRe: Problm in Copy to ClipBoard Pin
zahid_ash19-Apr-05 2:09
zahid_ash19-Apr-05 2:09 
GeneralCorrection Pin
fardak18-Apr-05 21:57
fardak18-Apr-05 21:57 
GeneralNeed Confirmation Pin
fardak18-Apr-05 21:49
fardak18-Apr-05 21:49 
GeneralRe: Need Confirmation Pin
mark novak19-Apr-05 0:04
mark novak19-Apr-05 0:04 
GeneralRe: Need Confirmation Pin
fardak19-Apr-05 0:15
fardak19-Apr-05 0:15 
GeneralRe: Need Confirmation Pin
mark novak19-Apr-05 1:03
mark novak19-Apr-05 1:03 
GeneralRe: Need Confirmation Pin
fardak19-Apr-05 2:15
fardak19-Apr-05 2:15 
GeneralRe: Need Confirmation Pin
mark novak19-Apr-05 2:36
mark novak19-Apr-05 2:36 
GeneralRe: Need Confirmation Pin
fardak19-Apr-05 3:28
fardak19-Apr-05 3:28 
GeneralRe: Need Confirmation Pin
mark novak19-Apr-05 3:36
mark novak19-Apr-05 3:36 
GeneralRe: Need Confirmation Pin
fardak19-Apr-05 4:08
fardak19-Apr-05 4:08 

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.