CreateWindowsEx made window without closing button

Sorry, this code is not c++ but Rust, but my question is about using WinApi CreateWindowEx and other functions like register window class.
I write project Rust, but main thing is about WinApi.
My project: https://drive.google.com/open?id=0B7E799YMGCWTMnRIV0YtMUc3dzA
I try many styles and I must have error?
Last edited on
The same thing in C++:
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
#include <Windows.h>

WNDCLASSEXW cl;

int main()
{
	HINSTANCE hmod = GetModuleHandleW(NULL);
	cl.cbSize = sizeof(cl);
	cl.style = CS_HREDRAW | CS_VREDRAW;
	cl.lpfnWndProc = DefWindowProc;
	cl.cbClsExtra = 0;
	cl.cbWndExtra = 0;
	cl.hInstance = hmod;
	cl.hIcon = NULL;
	cl.hCursor = LoadCursorW(NULL, IDC_ARROW);
	cl.hbrBackground = GetSysColorBrush(COLOR_BTNFACE + 3);
	cl.lpszMenuName = NULL;
	cl.lpszClassName = L"myclass";
	cl.hIconSm = NULL;
	RegisterClassExW(&cl);
	HWND hwnd = CreateWindowExW(
		WS_EX_CLIENTEDGE,
		L"myclass",
		L"Hello",
		WS_CAPTION,
		200,
		200,
		300,
		400,
		NULL,
		NULL,
		NULL,
		NULL
		);
	ShowWindow(hwnd, SW_SHOW);
	MSG msg;
	while (GetMessageW(&msg, NULL, 0, 0) != 0) {
		TranslateMessage(&msg);
		DispatchMessageW(&msg);
	}
}

Where are WinApi samples apart from MSDN ? - whole programs, not parts?
Last edited on
Topic archived. No new replies allowed.