The RegisterWindowMessage function is typically used to register messages for communicating between two cooperating applications. If two different applications register the same message string, the applications return the same message value. The message remains registered until the session ends. Only use RegisterWindowMessage when more than one application must process the same message. For sending private messages within a window class, an application can use any integer in the range WM_USER through 0x7FFF. (Messages in this range are private to a window class, not to an application. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use values in this range.) 

解决方案 »

  1.   

    RegisterWindowMessage()定义的消息可运用在整个程序中,也可以运行在不同的程序中,如果两个程序定义了相同的消息则返回相同的值。而WM_USER只能用于类中,其范围为ox7FFF
      

  2.   

    RegisterWindowMessage()定义的消息可在不同的程序中使用。而WM_USER只能用于一个应用中。如果你只有一个应用,则没有必要使用RegisterWindowMessage()。它一般用于多个应用进行交互的。
      

  3.   

    谢谢: 三位朋友.  不知我这样理解是不是正确?
       
      当我用RegisterWindowMessage()定义了一个Windows消息, 当这个应用送出这个消息,当前应用的窗口将收到消息.而另外一个应用如果定义了同样的消息,它的窗口也可以收到这个消息,尽管这个消息不是它本身的应用发出的.
    明天给分.