| INT EnableEvents( | 
             
            
              |   | 
              HWND hEventWnd, | 
                | 
             
            
              |   | 
              UINT uEventMsg | 
                | 
             
            
              | ); | 
             
           
         
        
          The EnableEvents method enables event notifications 
          using Windows messages. 
          This method has been deprecated and may be unavailable in future
          releases. It was designed for use in legacy single-threaded applications
          and requires the application to have a message pump to process event
          messages. It should not be used with applications which are designed
          to execute as a service or those which do not have a graphical user
          interface. 
          Applications should use the RegisterEvent 
          method to register an event handler which is invoked when an event 
          occurs. 
         
        Parameters
        
          
            - hEventWnd
 
            - Handle to the window which will receive the client notification
            messages. This parameter must specify a valid window handle. If a
            NULL handle is specified, event notification will be disabled.
 
            - uEventMsg
 
            - The message that is received when a client event occurs. This
            value must be greater than 1024.
 
           
         
        Return Value
        
          If the method succeeds, the return value is zero. If the method
          fails, the return value is WHOIS_ERROR. To get extended error
          information, call GetLastError. 
         
        Remarks
        
          The EnableEvents method is used to request that
          notification messages be posted to the specified window whenever a
          client event occurs. This allows an application to monitor the status
          of different client operations, such as a file transfer. 
          The wParam argument will contain the client handle, the low
          word of the lParam argument will contain the event ID, and the
          high word will contain any error code. If no error has occurred, the
          high word will always have a value of zero. The following events may
          be generated: 
         
        
          
            
              | Value | 
              Description | 
             
            
              | WHOIS_EVENT_CONNECT | 
              The connection to the server has completed. The high
              word of the lParam parameter should be checked, since this
              notification message will be posted if an error has
              occurred. | 
             
            
              | WHOIS_EVENT_DISCONNECT | 
              The server has closed the connection to the client. The
              client should read any remaining data and disconnect. | 
             
            
              | WHOIS_EVENT_READ | 
              Data is available to read by the calling process. No
              additional messages will be posted until the client has read at
              least some of the data. This event is only generated if the
              client is in asynchronous mode. | 
             
            
              | WHOIS_EVENT_WRITE | 
              The client can now write data. This notification is sent
              after a connection has been established, or after a previous
              attempt to write data has failed because it would result in a
              blocking operation. This event is only generated if the client is
              in asynchronous mode. | 
             
            
              | WHOIS_EVENT_TIMEOUT | 
              The network operation has exceeded the specified timeout
              period. The client application may attempt to retry the
              operation, or may disconnect from the server and report an error
              to the user. | 
             
            
              | WHOIS_EVENT_CANCEL | 
              The current operation has been canceled. Under most
              circumstances the client should disconnect from the server and
              re-connect if needed. After an operation has been canceled, the
              server may abort the connection or refuse to accept further
              commands from the client. | 
             
           
         
        
          To disable event notification, call the DisableEvents
          method. 
         
        Requirements
        
          Minimum Desktop Platform: Windows 7 Service Pack 1 
          Minimum Server Platform: Windows Server 2008 R2 Service Pack 1 
          Header File: cstools11.h 
          Import Library: cswhov11.lib 
         
        See Also
        
          DisableEvents, 
          RegisterEvent 
         
       |