1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_WIN_MESSAGE_WINDOW_H_
6 #define REMOTING_HOST_WIN_MESSAGE_WINDOW_H_
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/threading/non_thread_safe.h"
19 // Implements a message-only window.
20 class MessageWindow
: base::NonThreadSafe
{
22 // Handles incoming window messages.
25 virtual ~Delegate() {}
27 virtual bool HandleMessage(HWND hwnd
,
35 MessageWindow(const std::string
& class_name
, HINSTANCE instance
);
38 // Registers the window class and creates the window. The incoming messages
39 // will be handled by |delegate|. |delegate| must outlive |this|.
40 bool Create(Delegate
* delegate
);
42 HWND
hwnd() const { return window_
; }
45 // Invoked by the OS to process incoming window messages.
46 static LRESULT CALLBACK
WindowProc(HWND hwnd
, UINT message
, WPARAM wparam
,
49 // Atom representing the registered window class.
52 // MessageWindow class name.
53 std::string class_name_
;
55 // Instance of the module containing the window procedure.
58 // Handle of the input window.
61 DISALLOW_COPY_AND_ASSIGN(MessageWindow
);
65 } // namespace remoting
67 #endif // REMOTING_HOST_WIN_MESSAGE_WINDOW_H_