Solved

sendMessage or postMessage in Java

Posted on 2001-07-10
3
2,256 Views
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
0
Comment
Question by:rajinikarthikeyan
3 Comments
 
LVL 7

Accepted Solution

by:
Igor Bazarny earned 25 total points
ID: 6271166
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
 
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:

    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
 
LVL 14

Expert Comment

by:sudhakar_koundinya
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.
 
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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

707 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

14 Experts available now in Live!

Get 1:1 Help Now