sendMessage or postMessage in Java

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
rajinikarthikeyanAsked:
Who is Participating?
 
Igor BazarnyConnect With a Mentor Commented:
Hi,

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()?

Regards,
Igor Bazarny,
Brainbench MVP for Java 1
www.brainbench.com 
0
 
Jim CakalicConnect With a Mentor Senior Developer/ArchitectCommented:
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:

    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html
    http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html
    http://java.sun.com/products/jfc/tsc/articles/threads/threads3.html
    http://java.sun.com/products/jfc/tsc/articles/threads/update.html

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

Best regards,
Jim Cakalic
0
 
sudhakar_koundinyaCommented:
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.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
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.
0
All Courses

From novice to tech pro — start learning today.