Solved

Linux c++ equivalent to PostMessage()

Posted on 2003-11-12
3
2,011 Views
Last Modified: 2007-12-19
I am porting a Windows MFC app to linux.

It uses the PostMessage function to place a CString message "Message" in the Windows message queue as follows :

Window->PostMessage(Message);

How do I do the same in linux? I am developing using KDevelop 2.1 and QT3.

Help much appreciated.

regards,

Gordon
0
Comment
Question by:jeffreyg
3 Comments
 
LVL 45

Expert Comment

by:sunnycoder
Comment Utility
Hi jeffreyg,

> It uses the PostMessage function to place a CString message "Message" in the
> Windows message queue as follows
err I am not much familiar with windows but if you can tell what you wish to achieve in terms of absolute results, may be I can help

Cheers!
Sunny:o)
0
 
LVL 5

Accepted Solution

by:
mtmike earned 125 total points
Comment Utility
You can send events to an object (widget, window, etc) using

void QApplication::postEvent(QObject *receiver, QEvent *event);

To handle events in the window, override the event() method. You will have to define a new "string message" event type.

See http://doc.trolltech.com/3.1/qevent.html
0
 
LVL 7

Expert Comment

by:jconde
Comment Utility
Take a look at the way Slots and Signals work under Qt.  Even though I have no idea of what you're trying to accomplish, I'm almost certain using Signals will do what you need.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

13 Experts available now in Live!

Get 1:1 Help Now