forked from MicrosoftEdge/WebView2Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomStatusBar.cpp
More file actions
47 lines (35 loc) · 1013 Bytes
/
CustomStatusBar.cpp
File metadata and controls
47 lines (35 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "stdafx.h"
#include "CustomStatusBar.h"
#include "AppWindow.h"
CustomStatusBar::CustomStatusBar()
{
}
CustomStatusBar::~CustomStatusBar()
{
}
void CustomStatusBar::Initialize(AppWindow* appWindow)
{
m_appWindow = appWindow;
HWND mainWindow = m_appWindow->GetMainWindow();
int width = 600;
int height = 70;
int x = 50;
int y = 50;
m_statusBarWindow = CreateWindow(
L"Edit", L"", WS_CHILD | WS_BORDER | ES_READONLY, x, y, width, height, mainWindow,
nullptr, nullptr, 0);
BringWindowToTop(m_statusBarWindow);
}
void CustomStatusBar::Show(std::wstring value)
{
SetWindowTextW(m_statusBarWindow, value.c_str());
ShowWindow(m_statusBarWindow, SW_NORMAL);
}
void CustomStatusBar::Hide()
{
SetWindowTextW(m_statusBarWindow, L"");
ShowWindow(m_statusBarWindow, SW_HIDE);
}