Git Product home page Git Product logo

Comments (4)

kkjb avatar kkjb commented on September 23, 2024

You can chose the coffee instead

from shadowsocksr-csharp.

tonyke-bot avatar tonyke-bot commented on September 23, 2024

i see this line...and i thought my request is impossible to implement.
MenuViewController.cs#L195

            // we want to show more details but notify icon title is limited to 63 characters
            string text = (enabled ?
                    (global ? I18N.GetString("Global") : I18N.GetString("PAC")) :
                    I18N.GetString("Disable system proxy"))
                    + "\r\n"
                    + String.Format(I18N.GetString("Running: Port {0}"), config.localPort)  // this feedback is very important because they need to know Shadowsocks is running
                    ;
            _notifyIcon.Text = text.Substring(0, Math.Min(63, text.Length));

from shadowsocksr-csharp.

Akkariiin avatar Akkariiin commented on September 23, 2024

@THaGKI9
Yes, it's limited by windows.

from shadowsocksr-csharp.

tonyke-bot avatar tonyke-bot commented on September 23, 2024

@Akkariiin hello, the hero.

i found something on SO How can I show a systray tooltip longer than 63 chars?

this snippet may help, although a string longer than 63 chars shorter than 128 is supported only on win2k and later version of Windows.

public static void SetNotifyIconText(NotifyIcon ni, string text)
{
    if (text.Length >= 128) throw new ArgumentOutOfRangeException("Text limited to 127 characters");
    Type t = typeof(NotifyIcon);
    BindingFlags hidden = BindingFlags.NonPublic | BindingFlags.Instance;
    t.GetField("text", hidden).SetValue(ni, text);
    if ((bool)t.GetField("added", hidden).GetValue(ni))
        t.GetMethod("UpdateIcon", hidden).Invoke(ni, new object[] { true });
}

from shadowsocksr-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.