Announcement

Collapse
No announcement yet.

Desktop tooltips

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Desktop tooltips

    When I hover my mouse cursor over "My computer", "Network
    neighbourhood" or "Recycle bin" a tooltip appears. I would love
    to have these for my PB/DLL programs. Can it be done?

    Keith


    ------------------

  • #2
    You bet, we had a huge discussion on tooltips a while back, let me see if I can find the link:

    Code:
    '----------------------------------------------------------
    'ToolTips
    Type dField
        fName       As Asciiz * 80
        Size        As Integer
        Alignment   As Integer
    End Type
    Type ListData
        Columns As Integer
        Fields(0 To 80) As dField
        ToolTip As Asciiz * 30 'Testing
    End Type  
    
    
    '
    In PBMAIN:
    Dim ToolTxt(1 To 9) As Asciiz * 65
    Dim ti As TOOLINFO
    Local hWnd_ToolTip As Long
    
    hWnd_ToolTip = CreateWindowEx( 0, "tooltips_class32", "", %TTS_ALWAYSTIP, 0, 0, 0, 0, 0, ByVal 0&, GetModuleHandle(ByVal 0&), ByVal 0&)
    ti.cbSize   = Len(ti)
    ti.uFlags   = %TTF_SUBCLASS Or %TTF_IDISHWND
    ti.hWnd     = hDlg
    
    For lLoop = 1 To 9
    'THE WM_USER + 2047 IS the first button, it can be done differently
        'Pull string from re source file, or use an array here:
        LoadString g_hInst,(%WM_USER + 2047) + lLoop,ToolTxt(lLoop), SizeOf(ToolTxt(lLoop))
        ti.uId      = GetDlgItem(hDlg, (%WM_USER + 2047) + lLoop)
        ti.lpszText = VarPtr(ToolTxt(lLoop))
        SendMessage hWnd_ToolTip , %TTM_ADDTOOL, 0, ByVal VarPtr(ti)
    Next
    
    '
    '
    '
    '
    ------------------
    Scott
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      PS, search for "Tooltip tool tip" and find the post by me...




      ------------------
      Scott
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


      • #4
        Scott

        I found your post, entitled "ToolTip for ImgButtons" - many thanks.

        Perhaps I'm missing something, or I didn't make myself clear.
        I'm not talking about tooltips working from a running program,
        I'm talking about the tooltips you get by just hovering over a
        desktop icon. I've only seen it with the "My Computer",
        "Network neighbourhood" and "Recycle bin" icons so perhaps it's
        something specific to Microsoft and we can't do it. Hope not.

        Keith

        ------------------

        Comment


        • #5
          keith --
          probably you talk about a sample #2 in http://www.powerbasic.com/support/pb...ad.php?t=22658

          ------------------
          e-mail: [email protected]

          Comment


          • #6
            Keith,
            The text of the tooltip is stored in a key whose value is InfoTip in the registry.
            The standard desktop icons are in HKEY_CLASSES_ROOT\CLSID\... , but user shortcut
            tooltips could presumably be associated with the registered icon for the file or
            program elsewhere in HKEY_CLASSES_ROOT.

            I'll let you know if have any success.

            Regards, Simon

            ------------------

            Comment


            • #7
              Keith,

              I can't find a way to make a conventional shortcut icon on the Desktop
              (i.e. a .LNK or .PIF file in \Windows\Desktop) show a tooltip.
              Files with extension .URL (i.e. shortcuts to web sites) in \Windows\Desktop
              always show a tooltip, as do executables (.EXE) placed there. It is
              possible to put a program on the Desktop by putting its details in
              HKEY_CLASSES_ROOT\CLSID\... in the Registry and a tooltip is then possible,
              as described above.

              On my desktop, Psion have done this with their PsiWin program which
              connects to my PDA.

              Regards, Simon

              ------------------

              Comment


              • #8
                i fill "comments" field in http://www.powerbasic.com/support/pb...ad.php?t=24977 and explorer shows it (ie 5.5)

                ------------------
                e-mail: [email protected]

                Comment


                • #9
                  Simon

                  I was wondering why the commercial programs I have seen don't
                  have a DeskTop InfoTip but you confirm that at least one of
                  them does. It would seem such a nice feature to arrange at
                  install time and I would have thought it would be popular.
                  I will have a go at setting one up but I do not know much about
                  the registry yet and am therefore a little wary. Many thanks
                  for sharing your knowledge.

                  Semen

                  Your CreateShortcut subroutine looks very interesting and I
                  will experiment. Many thanks.

                  Keith


                  ------------------

                  Comment

                  Working...
                  X