C# Display text on the taskbar | Windows 10
Asked Answered
P

1

18

I want to display a text in the taskbar like the NetSpeedMonitor program . I thought about how Windows did that with der Date and Time display, but I couldn't find any answer. I want to do this with C# and .Net 4.x

enter image description here

Pitchfork answered 12/5, 2017 at 15:46 Comment(7)
1. Create Brush -> create bitmap -> create graphics -> Draw text on graphics -> convert to iconDichogamy
@ZachSchulze I already did that, but my Icon was always small, even when I used a bigger bitmap. I found a top about the max icon size: #32762963Pitchfork
What you're looking for is not a tray icon, but a panel.Mahogany
@Mahogany can you give me a small example please?Pitchfork
@Pitchfork codeproject.com/Articles/2219/…Dichogamy
@Pitchfork I also didn't know how this things are called. I've made a quick search and it seems that this functionality is often called "taskbar applet" (clocks, calculators, etc. built into taskbar on the left of the tray area, just as it is shown on your screenshot). Unfortunately, this functionality is not available in .Net, so you'd need to work with P\Invoke in order to use it. UPD: While I was typing, the link was posted above =)Mahogany
i answered to question dont forget approve it and if there was aany other question about it tell me freaandIleostomy
I
12

if you watch this pic

enter image description here

you see every thing in windows application have an handle(HWND) and if you get it you can change this app parameters and add or remove any thing on if look at this link there is sample for it in console application you just need just doing same thing on taskbar. I created a dll for all office apps to use them in c# like this and i done this by using handles of office and my app

Ileostomy answered 12/5, 2017 at 16:8 Comment(4)
I downloaded the File Win32Controls.cs and put in into my project. But I get an error at "using System.Windows.Native;" that its not there and that this is probably a assembly reference.Pitchfork
what is your Full error.? for using this functions you dont need more assembly you just import them by code too your projectIleostomy
Ok I translate the error in english: "The Type or Namespacename "Native" is not avaible in the Namespace "System.Windows. using-directive is unessescery". I just delete this line and the error is gone. I hope it didn´t affect the functionality. I am a c# beginner my main language is java :). Thx for helping.Pitchfork
You'r Wellcome friendIleostomy

© 2022 - 2024 — McMap. All rights reserved.