sendMessage or postMessage in Java

Posted on 2001-07-10
Last Modified: 2008-02-01
How do u send a Message to a message queue.
Send me the Source Code.
It should work like sendMessage and postMessage in MFC?
please reply me immediatelly
Question by:rajinikarthikeyan

Accepted Solution

Igor Bazarny earned 25 total points
ID: 6271166

Immediate answer--you can't. Java don't let you access to Windows message queue. There is java.awt.EventQueue class and java.awt.Toolkit.getSystemEventQueue() method which allow such low level manipulations with java event queue. You also can use JNI to call Win32 functions.

Can you provide more details? Why do you think you need sendMessage() or postMessage()?

Igor Bazarny,
Brainbench MVP for Java 1 
LVL 19

Assisted Solution

by:Jim Cakalic
Jim Cakalic earned 25 total points
ID: 6271381
Hmm. Are you speaking of the Swing Event Queue? Sounds like a job for the SwingUtilities class -- either invokeAndWait or invokeLater. Both methods take a Runnable, that is, an object of a class which implements the Runnable interface. The run method will be the action that you want to post on the Event Queue. You can find more detailed information in the following articles on the Swing Connection at the JDC:

Or perhaps you are talking about some other kind of queue?

Best regards,
Jim Cakalic
LVL 14

Expert Comment

ID: 9017699
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

[split points between bazarny and jim_cakalic]

Please leave any comments here within the next seven days.
EE Cleanup Volunteer
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is JNDI datasource in spring 1 50
@SBGen Method 3 38
micro services vs rest web services 16 86
Problem to start Neon 20 87
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now