Solved

Linux c++ equivalent to PostMessage()

Posted on 2003-11-12
3
2,036 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
ID: 9731256
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
ID: 9731651
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
ID: 9807851
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

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
Linux 10 106
Trying to install Node.js on Linux instance. Erroring.... 2 73
CRON expression that fires every other Tuesday 3 94
busybox bash/ash - bash -x | grep 19 121
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 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

18 Experts available now in Live!

Get 1:1 Help Now