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

Draken
  • 3,134
  • 13
  • 34
  • 54
Spidev
  • 193
  • 1
  • 6
  • 1. Create Brush -> create bitmap -> create graphics -> Draw text on graphics -> convert to icon – Zach Schulze May 12 '17 at 15:51
  • @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: http://stackoverflow.com/questions/32762463/windows-10-icons-in-taskbar-have-wrong-size?rq=1 – Spidev May 12 '17 at 15:52
  • What you're looking for is not a tray icon, but a panel. – Sergey.quixoticaxis.Ivanov May 12 '17 at 15:55
  • @Sergey.quixoticaxis.Ivanov can you give me a small example please? – Spidev May 12 '17 at 15:57
  • 3
    @Spidev https://www.codeproject.com/Articles/2219/Extending-Explorer-with-Band-Objects-using-NET-and – Zach Schulze May 12 '17 at 16:04
  • 1
    @Spidev 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 =) – Sergey.quixoticaxis.Ivanov May 12 '17 at 16:07
  • i answered to question dont forget approve it and if there was aany other question about it tell me freaand – Shahrooz Ansari May 12 '17 at 16:15

1 Answers1

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

Shahrooz Ansari
  • 2,637
  • 1
  • 13
  • 21
  • 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. – Spidev May 12 '17 at 16:41
  • what is your Full error.? for using this functions you dont need more assembly you just import them by code too your project – Shahrooz Ansari May 12 '17 at 16:42
  • 2
    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. – Spidev May 12 '17 at 16:48
  • You'r Wellcome friend – Shahrooz Ansari May 12 '17 at 16:51