messages

Avoiding instanceof when checking a message type

I have the following situation where a client class executes different behavior based on the type of message it receives. I'm wondering if there is a better way of doing this since I don't like the instanceof and the if statements. One thing I thought of doing was pulling the methods out of the client class and putting them into the mes...

Catching a WM_NOTIFY message from a custom ListCtrl

My application is c++, and is a combination of MFC and ATL. The part I'm working with here is MFC. I have a custom list control class in one of my dialogs which inherits from CListCtrl. I'm trying to add a handler for the LVN_ITEMCHANGED message so I can update the rest of the dialog form, which is dependant on the contents of the list...

WM_ERASEBKGND not followed by WM_PAINT

My app is getting a WM_ERASEBKGND message which is not followed by a WM_PAINT message. Naturally enough my application erases the background, and then just sits there with a blank window. I am running under Vista, but it happens under XP as well. I am pretty sure it is my fault, but what could I be doing so that Windows does not behave?...

How to send a notification that's handled by ON_NOTIFY?

I'm trying to post a LVN_ ITEMCHANGED to my custom gridlist's owner. I know how to send a WM_ User message using PostMessage (as shown here) ::PostMessage( AfxGetMainWnd()->GetSafeHwnd(), WM_REFRESH, (WPARAM)pBuffer, (LPARAM)GetOutputIdx() ); When I use this same code to send a LVN_ITEMCHANGED message though, ::PostMessage( AfxGetMa...

How to make a UIButton cause a UITextField to begin editing text

Hi. I have a custom field that allows the user to enter text in a UITextField. To the left of the UITextField is a UIButton. Something like this: ENTER YOUR NAME: [name input field] In the about the UIButton has the text "ENTER YOUR NAME:" and the UITextField is the [name input field]. When the user taps the UITextField, the keyboard...

[jQuery Validator] help with custom positioning error messages

Hello, I'm playing with the great Bassistance jQuery Validator and am stuck at a point The idea is simple: I have lot of this markup (I semplify, but the idea is that after each there could be something else, i.e. a word, an icon, etc... that is "inline" with the corresponding): <ol> <li><input type="text" id="width" size="3"></input> ...

Handling messages for window from other process

I'm developing a C# WPF application that reparents the main window of another application using a call to Win32 SetParent(). The handle to this out-of-process child window is wrapped by a class named FormHost which is derived from HwndHost. All is working well except for one thing: messages for the reparented window are not delivered to ...

Removing all the messages from MSMQ

I have a Nunit test which adds message into MSMQ. In the teardown of the NUnit i want to remove all the message from the queue. Is there a direct way to remove all the messages from the queue (some kind of refresh) ? ...

Send a message to a Windows Forms message loop

I have a thread that reads messages from a named pipe. It is a blocking read, which is why it's in its own thread. When this thread reads a message, I want it to notify the Windows Forms message loop running in the main thread that a message is ready. How can I do that? In win32 I would do a PostMessage, but that function does not seem t...

Keep track of read/unread User Messages with a MessageClicks table?

I'm trying to implement a simple Inbox system for users of my app so that can send basic messages to each other - just like in many forum systems. If User has_many :messages, how do I keep track of and notify the User of messages unread since last time they were read? I'm thinking clicks on the link to the Messages screen need to be re...

getting user defined messages using antlr3.0.1

numberrange returns [String value] : numberrangesub { String numberRange = ($numberrangesub.text); String [] v = numberRange.split(","); if ( Integer.parseInt(v[0].trim()) < Integer.parseInt(v[1].trim())) $value =numberRange; else throw new RecognitionException(); } ; Please obs...

Disable all notifictions of incomming messages in Symbian S60v3

How do I programmatically disable these notifications when a message is arriving on my symbian S60v3 phone: Message tone (I think I got that one) The led flashing The phone vibration The screen lights up The message icon (I think I got that one too) and what SDK can I use? I prefer to use Python, but I do not think the Python SDK for...

What is a good message broker that works with PHP?

I am looking for a message broker (like Apache ActiveMQ for Java) that works with PHP, preferably open-source. Any ideas? ...

Sending a message to an application started by a different windows' user session.

A desktop app (made in Delphi) is started by User A. Let's call it "Instance A". User A does a "switch user" and User B logs in. User B runs the same application. Let's call it "Instance B" What I want now, is a way for the Instance B to send messages to Instance A. I tried the following: Instance A writes its handle in a file, so I...

What is the output of this MPI simple program ?

Please could any one give me the output of this program and explain why: mpirub -np 2 ./prog.o #include "mpi.h" #include <math.h> #include <stdio.h> int main(int argc, char *argv[]) { int done = 0, n, myid, numprocs, i, rc; double PI25DT = 3.141592653589793238462643; double mypi, pi, h, sum, x, a; MPI_Init(&argc,&argv); MPI_Comm_size(...

Qt portable IPC: only QSharedMemory?

Hi, I'm looking for suggestions about choosing a portable way to achieve local IPC in a robust way, since i'm new to C++ and would like to avoid common pitfalls of fiddling with shared memory and locks; therefore I was thinking about message-passing style ipc. I was planning to use qt for other reasons anyway, thus i took a peek to Qt ...

keyboard hook in windows C++ or what?

Hi, I wish to build my own application which can send keyboard commands(messages) to the Windows OS. For example when I press ctrl+shit+n, I wish to launch the notepad.exe . How can I do that? Do you have some advices for me about the concept used. I've read that is possible when are used keyboard hooks? That's the only way? Do you ...

WCF Error : Manual addressing is enabled on this factory, so all messages sent must be pre-addressed.

First off, I'd like to thank those who have helped me out with this WCF connectivity, as it's fairly new to me. I've got a hosted WCF service that I created a custom factory for, so that this would work with multiple host headers: /// <summary> /// Required for hosting where multiple host headers are present /// </summary> public class...

C++ message passing doubts

Hello, I'm writing a piece of sotware that needs objects that exchange messages between each other. The messages have to have the following contents: Peer *srcPeer; const char* msgText; void* payload; int payLoadLen; now, Peer has to be a pointer as I have another class that manages Peers. For the rest I'm doubtful... for example I m...

jQuery queue messages

Hello, I've got a short function that should show messages on a website. function showHint() { $('#notify').html('message text').show('slide', {direction: 'right'}, 500); } And there is another function that hides the messages. function hideHint() { $('#notify').hide('slide', {direction: 'right'}, 500); } The Problem i...