Results 1 to 4 of 4

Thread: Raising windows message

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Hi,

    I'm implementing a function that requires me to specify a int value for a message to be received after the asynchronous function completes..

    My question is, what range of values should a user defined message be in? Obviously, I don't want to specify a value that is already used by a Win32 windows message.

    Any help would be appreciated..

    Dan

    Visual Studio 2010

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    For user messages, they must have values between 0x8000 and 0xBFFF to guarantee that they do not conflict with any system messages.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You can specify a user message like this:
    Code:
    #define MY_MESSAGE WM_USER + 1
    #define MY_MESSAGE_2 WM_USER + 2
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    WM_USER is also used by the other classes - only the range I gave is actually unused. MS says:
    Code:
    0 through WM_USER – 1  Messages reserved for use by the system. 
    WM_USER through 0x7FFF Integer messages for use by private window classes. 
    WM_APP through 0xBFFF  Messages available for use by applications. 
    0xC000 through 0xFFFF  String messages for use by applications. 
    Greater than 0xFFFF    Reserved by the system for future use.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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