Jump to content

I want to make a app that can show an image in the toolbar in windows. I don't mean taskbar or the system tray. 

 

I want to make something like this:

image.png.fb8fa1e9f37eb0d563b1802a5f393cca.png

This is a battery indicator on my lenovo laptop. 

 

I want to be able to show a picture that will change every 10 minutes. I am programming in java. Is this something possible or is this feature deprecated in windows now?

 

Edit: the reason I want to use a toolbar and not the system tray is because I want to be able to display images that are wide. The tray can only show tiny images that are of no use to me. 

Link to comment
https://linustechtips.com/topic/1195532-making-a-toolbar-app/
Share on other sites

Link to post
Share on other sites

On 5/16/2020 at 6:13 PM, Saksham said:

I want to make a app that can show an image in the toolbar in windows. I don't mean taskbar or the system tray. 

 

I want to make something like this:

 

This is a battery indicator on my lenovo laptop. 

 

I want to be able to show a picture that will change every 10 minutes. I am programming in java. Is this something possible or is this feature deprecated in windows now?

 

Edit: the reason I want to use a toolbar and not the system tray is because I want to be able to display images that are wide. The tray can only show tiny images that are of no use to me. 

 

 

It is a bit of  a pain to do, but apparently this should work

https://www.codeproject.com/Articles/2219/Extending-Explorer-with-Band-Objects-using-NET-and

That said, the above is for Windows XP and earlier.

 

You'll need to convert the interface 'IDeskBand' to 'IDeskBand2' for Vista and up (as the original article linked above was written for Windows 2000/XP)

https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ideskband2

 

Your application needs to be a Win32 one not UWP or PWA in order for it to work. Also note that Microsoft is providing no support for IDeskBand2, and is not promising that it will work in future version of Windows. Basically, Microsoft is saying: if it breaks, it breaks.

 

I can already tell you that the coming up (next year) Windows 10X (OS for devices where Windows 10 is not ideal example: low power devices (think Chromebook like systems) and dual screen devices)  will not support it due to fact that the taskbar has been scrap for a new one. In fact, the whole Shell32 has been kicked out, for CShell, the OS new GUI.

 

In addition, 10X has Win32 containerization feature (forced, can't be disabled). Apparently Microsoft is toying the idea to bring the concept to Windows 10 for adding a security layer, but will be optional and default turned off, as Microsoft expect program to break but wants people to test it... This, if enabled, will most likely break this feature, due to lack of support of this API from Microsoft. So you'll have to tell user to not enable this feature, if indeed it breaks it.

 

Link to comment
https://linustechtips.com/topic/1195532-making-a-toolbar-app/#findComment-13652225
Share on other sites

Link to post
Share on other sites

22 minutes ago, Saksham said:

@GoodBytes thanks for that. I appreciate you finding the correct implementation for me, but do you know if this is possible in Java? I'm not really comfortable in any other languages. 

Last time I worked with Java was ages ago, like really a long time ago.

When doing these software that interact with the OS APIs, let alone other components, you have to adapt and use the language supported for the given APIs. That would be, for Windows, C#, or C/C++ for more advanced stuff (that said, C# has the ability to call C/C++ libraries, so you have a possible work around if you work in C#). Why?

Well Windows is old, very old. At the time, the language of choice, for performance, was C and subsequently C++ which is fully backward compatible to C. Then Microsoft introduced their answer to Java: C#, which is superior in a lot of ways over Java, but Java has its strength, of course.

 

All to say, is that expect everything you find on Windows, in term of documentation and tutorial to be focused primary in C# and/or C/C++.

 

That said, you may be able to use this things called JNI (Java Native Interface) to interact in some fashion with DLL's to do things. It looks a bit janky, and don't ask me how to use it to do what you need to do, I don't know, but it is a solution. The big problem with it, is that it doesn't have Windows datatypes. So you'll need to figure out conversions... and you are in for a world of hurt.

 

Now, even if the above was no issue, and you can do everything with ease in Java. If you are considering yourself comfortable with Java, then great! Time to be not comfortable anymore and learn something new.  Putting several languages in your repertoire on your resume, shows that you can adapt to variety of languages. This mean that the company can be more comfortable with you tackling new projects in the future with the programming language of the month. Working with different programming languages, shows that programing itself, its not a challenge for you as you can adapt to whatever language which many of them shares a lot of similarities. What companies and team members prefers is problem solving skills.  In other words, when you come time to tackle a new project, and you come to them or they to you, you won't say "Oh sorry, I don't know abc.. I am out". You get to say "Yes!!! But its been a long time since I touch abc language..." or "....never coded with abc before.. but it looks like xyz, I don't mind learning", and there you go, you are onto a new project, even thaugh you are rusty, you'll grease up quickly and learn as you go, as you have that skill that you develop from leaning something new.

Link to comment
https://linustechtips.com/topic/1195532-making-a-toolbar-app/#findComment-13653744
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×