473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

NotifyIcon and SetForegroundWindow

I use NotifyIcon to minimize my app to the system tray. I also check
everytime my app runs for the previous instance, if it is running, call
SetForegroundWindow to bring its window up front and exit the second
instance.

The problem is it doesn't bring the app out of the system tray. It works
fine if the app is NOT in the system tray. How do I bring it out of the
system tray and make it an active window? Thanks
Nov 20 '05 #1
1 1700
John,

I misread this the last time you asked it. I understand now what you're
trying to do.

What you have to do is, rather than the new instance trying to restore the
existing instance, the new instance should send a WM_SETTEXT Windows message
from the new instance to the original instance using the SendMessage API
function. This way you can send a specifically coded text message to the
original application. The original application can be programmed to
recognize this code and, in response, restore itself properly.

Hope this helps.

Dale
"John" <so@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I use NotifyIcon to minimize my app to the system tray. I also check
everytime my app runs for the previous instance, if it is running, call
SetForegroundWindow to bring its window up front and exit the second
instance.

The problem is it doesn't bring the app out of the system tray. It works
fine if the app is NOT in the system tray. How do I bring it out of the
system tray and make it an active window? Thanks

Nov 20 '05 #2

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

Similar topics

1
by: John | last post by:
I use NotifyIcon to minimize my app to the system tray. I also check everytime my app runs for the previous instance, if it is running, call SetForegroundWindow to bring its window up front and...
5
by: Phil Galey | last post by:
VB.NET 2002 on Windows 2000 SP 3 When I start my program, the NotifyIcon appears in the tray, as it should. However, when I close the program, the NotifyIcon remains until I hover over it with...
0
by: petterl | last post by:
I have tried to find the error in the code below but I always get " An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module. Additional information: Object...
2
by: Rob Mayo | last post by:
OK, maybe this is my opinion, maybe these are bugs. Given the folowing: I have a NotifyIcon on my Form, a Context menu associated with the NotifyIcon, and a MenuItem on the ContextMenu set as...
3
by: Glen | last post by:
Can anyone tell me if there is a workable method to get the mouse cursor position on the screen or the NotifyIcon position? I need to display a context menu for the NotifyIcon when clicked and I'd...
2
by: Derrick | last post by:
I've been working on an application which has a NotifyIcon (system tray icon), and a corresponding ContextMenu. I want to be able to update this menu dynamically. However, when I make changes to...
12
by: mdb | last post by:
My app has a notify icon in the systray. I want the left mouse click to initiate a menu, and a right-mouse click to do something else. Normally, for a button, I would listen to MouseDown and if I...
3
by: SteveMac | last post by:
I am using VS2003 VC++ .NET. I want to make a tray icon with a popup menu (like a context menu) that pops up for a left click. I can make the notifyicon with a context menu and that works fine,...
6
Kevinyy
by: Kevinyy | last post by:
How can i focus/make active/bring to front my program when i double click the notify icon? I have: show in taskbar = false i have tried: dll reference or setforegroundwindow(this.handle);...
1
by: \Ji Zhou [MSFT]\ | last post by:
Hello Jason, Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou and I will be working on this issue with you. I have tried to but cannot reproduce your issue on my side....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.