ToolTip geht gar nicht !



  • hallo,
    hab im MSDN 2 Stunde gelesen, geht es immer noch nicht.
    "The following example demonstrates how to create a standard ToolTip control for a window's entire client area. "

    TOOLINFO ti = { 0 };
    
           case WM_CREATE :
    icctrl.dwSize = sizeof(INITCOMMONCONTROLSEX);
    icctrl.dwICC = ICC_TAB_CLASSES ;
    InitCommonControlsEx(&icctrl);
    
        ti.cbSize = sizeof(TOOLINFO);
        ti.uFlags = TTF_SUBCLASS;
        ti.hwnd = hwnd;
        ti.hinst = hInstance;
        ti.lpszText = TEXT("This is your ToolTip string.");;
    
         hTip = CreateWindowEx(NULL,
            TOOLTIPS_CLASS, NULL,
            WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,		
            0, 0,
            23, 23,
            hwnd, NULL, hInstance,NULL);
    
        SetWindowPos( hTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); 
        SendMessage(hTip, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
    

    wie kann ich weiter gehen? mit WM_MOUSEMOVE? bitte helfe! vielen Dank!



  • Was geht denn genau nicht? Wird der ToolTip überhaupt nicht angezeigt? Was meinst du mit weiter gehen?



  • ja, richtig, der ToolTip wird überhaupt nicht angezeigt.


  • Mod

    Wie wäre es mal mit einem bischen Literatur...
    http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx

    Du hast TTF_SUBCLASS nicht eingesetzt!
    Du hast TTM_RELAYEVENT nicht eingesetzt soweit ich es sehe.
    http://msdn.microsoft.com/en-us/library/bb760403(VS.85).aspx

    HWND_TOPMOST für ein Tooltip zu setzen ist Unfug und unnötig.



  • bingo !!!!!!!!!!!!!
    wegen:
    #if defined _M_IX86
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language=''\"")
    #elif defined _M_IA64
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='
    '\"")
    #elif defined _M_X64
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language=''\"")
    #else
    #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='
    ' publicKeyToken='6595b64144ccf1df' language='*'\"")
    #endif

    @Martin Richter: merry christmas!
    Mit der obigen Dinge, wie sieht es aus, dass mein Code in anderem Computer läuft? kannst du mir mal sagen, wie ich ohne diese zu tippen, aber meine VS2008 etwas einstellen kann? dank sehr.



  • ok, erledigt!
    ohne die #if defined _M_IX86 ... zu tippen, braucht man rt_manifest .


Anmelden zum Antworten