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
|
#include <windows.h>
#include <TriBase.h>
//#include <WinDef.h> Nur zu Testzwecken - stand im MSDN
HWND g_hWindow;
tbResult InitWindow(int iWidht,int iHeight,char* pcName,HICON hicon)
{
WNDCLASSEX WindowClass = {sizeof(WNDCLASSEX), CS_CLASSDC, WindowProc, 0, 0,
GetModuleHandle(NULL), NULL, NULL, NULL, "test", NULL};
if(!RegisterClassEx(&WindowClass))
{
TB_ERROR("Fensterklassenregistrierung fehlgeschlagen",TB_ERROR);
}
TB_INFO("Fensterklasse wurde registriert!");
RECT Rect;
SetRect(&Rect,0,0,iWidht,iHeight);
AdjustWindowRect(&Rect,WS_VISIBLE | WS_OVERLAPPEDWINDOW,FALSE);
iWidht = Rect.right - Rect.left;
iHeight = Rect.bottom - Rect.top;
g_hWindow = CreateWindow(
"Direct 3D Window",
pcName,
WS_VISIBLE | WS_OVERLAPPEDWINDOW,
GetSystemMetrics(SM_CXSCREEN) / 2 - iWidht /2,
GetSystemMetrics(SM_CYSCREEN) / 2 - iHeight /2,
iWidht,
iHeight,
NULL,
NULL,
GetModuleHandle(NULL),
NULL);
return TB_OK;
}
|