473,763 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOW TO: Win32 API - Get all windows, draw a icon and bring the windowsto the systray

Hi newsgroup,

What I intend to do:
Write a small programm, that will add a new Button to every Window right
beside the Buttons for minimizing, maximizing and closing the window in
the window's titlebar. When this button is clicked the window itself
should be minimized to the systray

On my way there I found hardly any example via Google that suited my needs.
All I know about already is how to get all windows in VB.Net ( which
actually isn't C#, so I got a bit confused by the different syntax )

I would be thankful for *any* help that could be granted.
Especially on getting all (active ?) windows, drawing a icon onto them
and minimizing them to the systray.
Thx in advance for any help

Christoph
Nov 16 '05 #1
1 4171
Hi,

The most challenging part of your task will be creating buttons on the
windows' title bars. The thing is you'll have to subclass every window in
order to add something to it's title bar. More than that, how about windows
who have custom title bars or even window shapes?

Regarding drawing on a window's toolbar, see my reply to redneon below (the
answer fully applies if the window is a window belonging to your
application, but the idea to handle WM_NC* messages is still valid for
customizing other applications' windows).

As for minimizing to the tray, there's nothing like that in the API - you'll
have to minimize and hide the window and add an icon to the tray manually -
as well as to add handling for clicking on that icon in order to show and
restore the window.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Christoph Engelhardt" <me***@setiherb ipolis.de> wrote in message
news:uw******** *****@TK2MSFTNG P11.phx.gbl...
Hi newsgroup,

What I intend to do:
Write a small programm, that will add a new Button to every Window right
beside the Buttons for minimizing, maximizing and closing the window in
the window's titlebar. When this button is clicked the window itself
should be minimized to the systray

On my way there I found hardly any example via Google that suited my
needs.
All I know about already is how to get all windows in VB.Net ( which
actually isn't C#, so I got a bit confused by the different syntax )

I would be thankful for *any* help that could be granted.
Especially on getting all (active ?) windows, drawing a icon onto them
and minimizing them to the systray.
Thx in advance for any help

Christoph


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
10324
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
6
9923
by: Action | last post by:
I can add a systray icon in normal windows application... but when i do it in windows service, the systray icon just don't show up is that because i don't have any "component" to contain the systray icon? please give direction... thx
1
4828
by: Fast Eddie | last post by:
Can anyone tell me a good way to make a blinking systray icon? I want it to alternate between two icons. I've tried toggling between two notifyIcons and alternating the visible variable - but that makes the taskbar blink. I'm new to C# so I'm not really sure where the drawing mechanism takes place, else I could probably just swap the notifyicon objects. Any ideas? Thanks. FE
5
14595
by: christopher green | last post by:
I am writing a C# windows application but I don't want to display any forms, effectively I want it to be invisible on the desktop apart from an icon in the system tray. How can I do this? I know I can start an application minimised but I don't want to display any forms. Thanks for your assistance. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
8
2275
by: Jacek Jurkowski | last post by:
1) How to prevent user to run secound copy of application on the same mahine? I would like to show dialog "Already run" instead of launching a secound insrance. 2) Why, if minimized into a notify icon, my application prevents Windows from shutdown and restart? I'm handling SessionEnding event and it works fine if application window is showed to the user but when window is hidden and notyfy icon is displayed instead, it doesn't work at...
3
1940
by: Brent Burkart | last post by:
I haven't dived into creating my windows service yet, but after looking around I have not discovered how to make the service icon appear in the lower right hand corner and how to make a menu to allow the user to change configurations. Any thoughts or directions are appreciated. Thanks, Brent
4
1162
by: Water Cooler v2 | last post by:
I want to run a service at the background but also provide some user interface for editing some configuration options. In this regard, my questions are: 1. Can a Windows Service have a UI along with it? 2. Can I associate a NotifyIcon (systray icon) with a Web service? 3. Can a Windows service be such that it runs only on a particular Windows account on the domain? I mean can it use Windows Authentication to see if it must start up on a...
6
5614
by: Nathan Laff | last post by:
Why when I inherit a ComboBox and make no code changes, when I set the new control DropDownStyle to dropDownList it appears different than the standard ComboBox control on Vista? In Windows Vista when this mode is set, the control is all one color indicating that you can't type in it and looks really slick. How do i reproduce this behavior?
7
1860
by: Jassim Rahma | last post by:
did you see the CNN or BBC dekstop news alert software? I want to develop the same but for banner advertisment and I want to if I should do it as system tray ir windows services?
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.