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

Program 1 opens, triggers an event in program 2

When application #1 opens, I would like it to trigger an event in
application #2.

How do you send a message from one window to another? How can
application #1 look to see if application #2 is open, and if it is,
notify application #2 that it has started?

I know that using the win32 api there's a way to send messages between
windows, but I don't know how that translates into .NET.

I posted a similar question in the past and received a suggestion about
remoting. I've looked into remoting and I wonder if there's not a more
straightforward way.

Thanks!

Patrick
Nov 16 '05 #1
1 918
You could use P/Invoke to get the Win32 API calls that would allow you
to create a custom windows message and then find the handle of the
window that you want to communicate with and then pass the message;
while the target window overrides Control.PreProcessMessage in order to
intercept the custom message.

However, by the time that you have done all of that, you really don't
have something that is more straightforward than Remoting, which is
really quite simple to use and understand once you take the plunge and
just write a little code to try it out.

If you really want to go the windows messages route, here's a link that
ought to start you in the right direction:
http://tinyurl.com/3tsmj

Regards,

Adam

Nov 16 '05 #2

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

Similar topics

10
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
2
by: cefrancke | last post by:
I have a datagrid on a windows form with a bindingnavigator. The tableadapter, bindingsource and dataset are there also. I can browse and edit data normally. I had added the "click" event...
1
by: Dabbler | last post by:
I have a GridView which triggers the SelectedIndexChanging event when I click on the row anywhere implemented by this code in RowDataBound event handler: if ( e.Row.RowType ==...
1
by: josh | last post by:
Hi, I have several independent, system components that write audit events to a database locally via ODBC and remotely via TCP, and I have a requirement to audit when the database is available for...
1
by: superjacent | last post by:
Hope someone can point me in the right direction. When opening a form the 'click' event of the ListBox is invoked (run). I thought the 'click' event of the ListBox is only invoked when clicking...
7
by: ajomara | last post by:
Hai everyboby i am new to this group,can one help me in triggers could anyone help in the fallowing lines "Database triggers can be system triggers on a database or a schema. With a...
2
by: femtox77 | last post by:
Hi to all! Do you know if i can execute a macro at exit of a program? If yes, how can i do it? Thank to all Femtox
0
debasisdas
by: debasisdas | last post by:
This thread contains some useful tips/sample codes regarding TRIGGERS in oracle, that the forum members may find useful. TRIGGERS: =============== Database trigger is a PL/SQL block that is...
0
by: Alan Mailer | last post by:
After a user edits a Cell in one of my DataGridViews, I want to make sure what the user has typed in is 'valid'. If it's not, I want to Cancel the Edit. Ok, you say, use the CellValidating...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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:
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
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...

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.