Skip to content

Commit 953795f

Browse files
committed
ISSUE-21: Added a caption argument to the Win32RenderWindow constructor.
1 parent 13944ba commit 953795f

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

win32/N3888_RefImpl/Win32RenderWindow.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LRESULT CALLBACK InternalWindowProc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM
1414

1515

1616

17-
Win32RenderWindow::Win32RenderWindow( unsigned int width, unsigned int height ) :
17+
Win32RenderWindow::Win32RenderWindow(unsigned int width, unsigned int height, const std::wstring& caption) :
1818
handle( 0 )
1919
{
2020
WNDCLASSEX wc;
@@ -32,14 +32,14 @@ Win32RenderWindow::Win32RenderWindow( unsigned int width, unsigned int height )
3232
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
3333
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
3434
wc.lpszMenuName = NULL;
35-
wc.lpszClassName = L"HieroglyphWin32";
36-
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
35+
wc.lpszClassName = L"N3888_RefImpl";
36+
wc.hIconSm = LoadIcon(NULL, IDI_ASTERISK);
3737

3838

3939
// Register the window class
4040
RegisterClassEx(&wc);
4141

42-
// Record the desired device size
42+
// Record the desired client window size
4343
RECT rc;
4444
rc.top = rc.left = 0;
4545
rc.right = width;
@@ -59,7 +59,7 @@ Win32RenderWindow::Win32RenderWindow( unsigned int width, unsigned int height )
5959
handle = CreateWindowEx(
6060
NULL, // extended style
6161
wc.lpszClassName, // class name
62-
L"N3888_RefImpl", // instance title
62+
caption.c_str(), // instance title
6363
(WS_OVERLAPPEDWINDOW | WS_VISIBLE), // window style
6464
lleft, ltop, // initial x, y
6565
lwidth, // initial width

win32/N3888_RefImpl/Win32RenderWindow.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
66
#include <windows.h>
7+
#include <string>
78

89
class Win32RenderWindow
910
{
1011
public:
1112

12-
Win32RenderWindow( unsigned int width, unsigned int height );
13+
Win32RenderWindow( unsigned int width, unsigned int height, const std::wstring& caption );
1314
~Win32RenderWindow();
1415

1516
LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);

win32/N3888_RefImpl/entrypoint-win32.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ int WINAPI wWinMain(
188188

189189
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_N3888_REFIMPL));
190190

191-
Win32RenderWindow window( 320, 240 );
191+
Win32RenderWindow window( 320, 240, L"N3888_RefImpl rocks!" );
192+
Win32RenderWindow window2(320, 240, L"N3888_RefImpl rocks two times!");
192193

193194
// Main message loop:
194195
while (msg.message != WM_QUIT) {

0 commit comments

Comments
 (0)