Solved

Linux c++ equivalent to PostMessage()

Posted on 2003-11-12
3
2,080 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

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