editbox-Fenster ohne Leiste



  • Martin Richter schrieb:

    Du hast doch schon ein vollständiges Sample bekommen:
    http://www.c-plusplus.net/forum/viewtopic-var-t-is-164449-and-postdays-is-0-and-postorder-is-asc-and-start-is-10.html

    es funktioniert aber leider nicht. es passiert rein gar nix. alles wird durchlaufen und scheibar erstellt, aber der tooltip kommt nicht hervor :(.



  • kann es sein, das tooltip prinzipell nur für dialoge definierbar sein? irgendwie bezieht sich jedesbeispiel was man bei msdn findet auf dialoge.....


  • Mod

    Nein das ist wurscht. Ich verwende Tooltips überall..



  • kann es sein das ich jedes element subclassen muss, bevor ich ein tooltip dafür benutzen kann, sprich jeden button, fensterbereich usw.?


  • Mod

    Nein!



  • siehst du an diesem beispiel code einen fehler?

    mein derzeitiges ziel ist es, einem leeren fenster übere die kompletten client-area einen tooltip zuzuweisen, erwartungsgemäß klappt das wieder nicht 😞

    Aufrufen tut ich die Methode während WM_CREATE des Hauptfenster(für das ich den tooltip ja auch erzeugen möchte)

    ich versteh mein problem leider nicht, es läuft alles durch. die handle sind != NULL, die .lib ins drin und das headerfile. ich mach den initcontrol.....was fehlt/ist falsch?

    void CreateMyTooltip (HWND hwnd)
    {
                     // struct specifying control classes to register
        INITCOMMONCONTROLSEX iccex; 
        HWND hwndTT;                 // handle to the ToolTip control
              // struct specifying info about tool in ToolTip control
        TOOLINFO ti;
        unsigned int uid = 0;       // for ti initialization
        LPTSTR lptstr = L"This is your ToolTip string.";
        RECT rect;                  // for client area coordinates
    
        /* INITIALIZE COMMON CONTROLS */
        iccex.dwICC = ICC_WIN95_CLASSES;
        iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
        InitCommonControlsEx(&iccex);
    
        /* CREATE A TOOLTIP WINDOW */
        hwndTT = CreateWindowEx(WS_EX_TOPMOST,
            TOOLTIPS_CLASS,
            NULL,
            WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,		
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            CW_USEDEFAULT,
            hwnd,
            NULL,
            hInst,
            NULL
            );
    
        SetWindowPos(hwndTT,
            HWND_TOPMOST,
            0,
            0,
            0,
            0,
            SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
    
        /* GET COORDINATES OF THE MAIN CLIENT AREA */
        GetClientRect (hwnd, &rect);
    
        /* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */
        ti.cbSize = sizeof(TOOLINFO);
        ti.uFlags = TTF_SUBCLASS;
        ti.hwnd = hwnd;
    	ti.hinst = hInst;
        ti.uId = uid;
        ti.lpszText = lptstr;
            // ToolTip control will cover the whole window
        ti.rect.left = rect.left;    
        ti.rect.top = rect.top;
        ti.rect.right = rect.right;
        ti.rect.bottom = rect.bottom;
    
        /* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */
        SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);	
    
    }
    


  • hat keiner ne idee. ich verzweifel wirklich total daran, dass ich nicht rauskrieg woran das liegt dsa er mir zum verrecken keinen tooltip erstellen will.

    Kein Beispiel funktioniert bei mir 😞


Anmelden zum Antworten