473,434 Members | 1,462 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,434 software developers and data experts.

Sending Window Messages from an MFC app to a Windows Firm tray application

Hello,

I have an MFC MDI application and a Windows Forms (2.0) Tray Icon
application.
I want to run a command on the tray application via my MFC application.
There is a "Register" context menu command on the tray icon application.
I want to call the Register command from my MFC MDI application.

I thought of a windows message.
How do I do it?
Is there any other better mechanism to do so?
Thanks,
Janiv Ratson.
Jul 4 '06 #1
1 2033
If you know the class of the window on the tray application you can use
FindWindow() to get the window for the class. Then you can use either
PostMessage() or SendMessage() to send a message to that window. You should
be able to use the same message ID that is generated when you select the
functionality from the menu in the application. Basically, the tray
application will not know the difference between the message that came from
the outside or the one from its own menu.

Tom

"Janiv Ratson" <janivr@gmailcomwrote in message
news:eC****************@TK2MSFTNGP04.phx.gbl...
Hello,

I have an MFC MDI application and a Windows Forms (2.0) Tray Icon
application.
I want to run a command on the tray application via my MFC application.
There is a "Register" context menu command on the tray icon application.
I want to call the Register command from my MFC MDI application.

I thought of a windows message.
How do I do it?
Is there any other better mechanism to do so?
Thanks,
Janiv Ratson.


Jul 4 '06 #2

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

Similar topics

2
by: Austin | last post by:
I wrote a GUI program with wxPython. In the window, there are 3 attributes on left top. "_" could let the program to minimize to tool bar. I want to let the program minimized to the system tray....
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
4
by: utkarsh | last post by:
Hi, I want to develop a Window Service in C# that should be capable of sisplaying the a icon in the window tray. Based on some logic in service, icon should be changed to some other...
7
by: Mike Eaton | last post by:
Hi All, I have a simple application that allows users to clock in and out and stores the data for use by the payroll department. It spends most of its life as a tray icon and when the user...
0
by: pigeonrandle | last post by:
Hi, I'm trying to redirect click events from a panel in my application to another applications window such that i 'click' the menu of the other application. I (naively) thought i could just...
8
by: mtsweep | last post by:
Hi, I started a background thread to preform some time intensive tasks for a GUI frontend. This background thread uses a C++ object which requires a windows message loop so I started one in it...
4
by: InnoCreate | last post by:
Hi Everyone, I've added an error handler to some code and as part for the routine it logs to the application log and then sends the administrator an email. For some reason this email isn't...
10
by: Mark Rae [MVP] | last post by:
Hi, This is really just a theoretical question for my own interest, and not for any nefarious purpose... :-) Say we have three applications running - Notepad, Wordpad and Excel - and each...
5
by: uvklein | last post by:
Hi there, I'm writing an application with forms. my main window can be hidden (minimize to a tray icon) like...Microsoft Outlook for example. this application can run only one instance (again...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.