Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 899615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:14:55+00:00 2026-05-15T15:14:55+00:00

Windows messages seems a good way to notify an application on Windows OSes. It

  • 0

Windows messages seems a good way to notify an application on Windows OSes. It actually works well, but few question comes up to my mind:

How to specify structured data to the lparam of the SendMessage routines (like many message codes does)? I mean… of course the parameter is a pointer, but how the process access to it? Maybe is it allocated by a DLL loaded by the processes sending/receiving the message?

Is it possible to share message structured parameters (between sender and receiver)? They are marshalled between the send operation and the peeking operation? If this is the case, it is possible to return data from the caller by modifying the structured parameter? This could be usefull with SendMessage, since it is executed synchronously, instead the PostMessage routine.

Other doubts…

What the differences from PostMessage and SendNotifyMessage?

Is it possible to cause a deadlock in the case an application calls SendMessage to itself while processing the message pump?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:14:56+00:00Added an answer on May 15, 2026 at 3:14 pm

    If the message is one of the standard window’s messages – usually with a message id between 0 and WM_USER, then the systems window message dispatching logic contains code to marshal the struct to the any processes the message is dispatched to.

    Messages above WM_USER get no such treatment – and this includes all the common control messages introduced with Windows 95 – you cannot end any of the LVM_* (list view messages) or other new control messages to a control in a different process and get a result back.

    WM_COPYDATA was specifically introduced as a general purpose mechanism for user code to marshal arbitrary data between processes – outside of WM_COPYDATA (or reusing other windows standard messages) there is no way to get windows to automatically marshal structured data using the message queue mechanism into another process.

    If it is your own code doing the sending AND receiving of messages, you could use a dll to define a shared memory section, instead of sending pointers (the dll might be based differently in each process) sends offsets to the shared memory block.

    If you want to exchange structured data with external applications that do not marshal their data (for example to extract data from a list or tree view) then you need to perform dll injection so you can send and process the message from “in-process”.


    SendNofityMessage is different to PostMessage because PostMessage always puts the message in the message queue, whereas SendNotifyMessage acts like SendMessage for windows in the same process. Then, even if the target window is in another process, the message is dispatched DIRECTLY to the window proc not placed in the posted message queue for retreivel via GetMessage or PeekMessage.


    Lastly it is possible to cause a deadlock – however while in a “blocking” sendmessage waiting for another thread to reply, SendMessage will dispatch messages sent (not posted) from other threads – to prevent deadlocks. This mitigates most potential deadlocks, but its still possible to create deadlocks by calling other blocking apis, or going into modal message processing loops.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I a have a multithread application (MIDAS) that makes uses of windows messages to
I have a windows service listening to messages from a queue but the messages
I am trying to retrieve messages for another application with a Windows hook. I
The Indy UDP server component seems to depend on Windows messages, as I see
I am writing a Windows service that pulls messages from an MSMQ and posts
I am creating a Windows Service in C# that processes messages from a queue.
I have been experimenting with sending messages from two .NET Windows Forms applications using
I've got a Polish version of Windows installed and therefore I get exception messages
I need to understand the differences between windows main/mdi/child/dialogs.... how win32 messages should be
Is there a way to intercept window messages from another app other than a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.