Solved

sendMessage or postMessage in Java

Posted on 2001-07-10
3
2,377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jboss wildfly 10.1 10 437
How do I remove an object from a 3 53
going to wrong jsp page 2 50
maven disable workspace resolution 1 42
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…
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

730 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