CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    116

    user defined messages

    hw to declare and use user defined messages and to send them to a another wnd
    ?

  2. #2
    Join Date
    Aug 1999
    Location
    Wisconsin
    Posts
    507
    For defining messages:

    #define WM_SOME_MESSAGE WM_USER+1
    etc.

    For sending messages, use PostMessage() or
    SendMessage()

  3. #3
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863
    It is better to use WM_APP.

    Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application, because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  4. #4
    Join Date
    Aug 1999
    Location
    Germany
    Posts
    2,338
    You could use RegisterWindowMessage("AUniqueStringForYourApp") as well.

  5. #5
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Although it deals with accessing control (CWnd's) out of a thread, the following FAQ will show how to send a user-defined message...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured