2014-05-13 18:00:26 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#ifndef RTC_BASE_WIN32_WINDOW_H_
|
|
|
|
|
#define RTC_BASE_WIN32_WINDOW_H_
|
2014-05-13 18:00:26 +00:00
|
|
|
|
2017-06-29 07:52:50 +02:00
|
|
|
#if defined(WEBRTC_WIN)
|
2014-05-13 18:00:26 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/win32.h"
|
2017-06-29 07:52:50 +02:00
|
|
|
|
|
|
|
|
namespace rtc {
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Win32Window
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class Win32Window {
|
|
|
|
|
public:
|
|
|
|
|
Win32Window();
|
|
|
|
|
virtual ~Win32Window();
|
|
|
|
|
|
|
|
|
|
HWND handle() const { return wnd_; }
|
|
|
|
|
|
2018-06-19 15:03:05 +02:00
|
|
|
bool Create(HWND parent,
|
|
|
|
|
const wchar_t* title,
|
|
|
|
|
DWORD style,
|
|
|
|
|
DWORD exstyle,
|
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int cx,
|
|
|
|
|
int cy);
|
2017-06-29 07:52:50 +02:00
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
|
|
// Call this when your DLL unloads.
|
|
|
|
|
static void Shutdown();
|
|
|
|
|
|
|
|
|
|
protected:
|
2018-06-19 15:03:05 +02:00
|
|
|
virtual bool OnMessage(UINT uMsg,
|
|
|
|
|
WPARAM wParam,
|
|
|
|
|
LPARAM lParam,
|
2017-06-29 07:52:50 +02:00
|
|
|
LRESULT& result);
|
|
|
|
|
|
2017-10-24 10:08:26 -07:00
|
|
|
virtual bool OnClose();
|
|
|
|
|
virtual void OnNcDestroy();
|
2017-06-29 07:52:50 +02:00
|
|
|
|
|
|
|
|
private:
|
2018-06-19 15:03:05 +02:00
|
|
|
static LRESULT CALLBACK WndProc(HWND hwnd,
|
|
|
|
|
UINT uMsg,
|
|
|
|
|
WPARAM wParam,
|
2017-06-29 07:52:50 +02:00
|
|
|
LPARAM lParam);
|
|
|
|
|
|
|
|
|
|
HWND wnd_;
|
|
|
|
|
static HINSTANCE instance_;
|
|
|
|
|
static ATOM window_class_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
} // namespace rtc
|
|
|
|
|
|
2017-06-29 08:03:04 +02:00
|
|
|
#endif // WEBRTC_WIN
|
2014-05-13 18:00:26 +00:00
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#endif // RTC_BASE_WIN32_WINDOW_H_
|