?
Solved

Linux c++ equivalent to PostMessage()

Posted on 2003-11-12
3
Medium Priority
?
2,182 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
[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 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 375 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

650 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