How can I show a systray tooltip longer than 63 chars?

后端 未结 5 739
不知归路
不知归路 2021-02-02 12:48

How can I show a systray tooltip longer than 63 chars? NotifyIcon.Text has a 63 chars limit, but I\'ve seen that VNC Server has a longer tooltip.

How can I do what VNC S

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-02 12:59

    bk1e here says that the limit is 128 chars, now, if you use UTF-16, which is the native unicode format in windows and especially .NET, that means you are limited to 64 characters, including the NUL.

    I would believe that you're using a unicode API which limits tooltips to 64 16-bit characters (including the null), and that VNC Server uses ascii (or ANSI) api's instead, allowing the use of 128 8-bit characters (including the null).

    EDIT: This answer is wrong, here is a helpful comment by Cody Gray explaining why:

    This reasoning is compelling, but is not actually correct. When the MSDN documentation talks about "characters", it actually means the number of char or wchar_t items in the array (depending on whether you're targeting Unicode). So you get the full 128 characters promised when running on Windows 2000+. Windows 9x was limited to 64 characters. – Cody Gray Jun 19 at 4:11"

提交回复
热议问题