Professional Documents
Culture Documents
Ppe 3
Ppe 3
h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include "resource.h"
#include "math.h"
if (!RegisterClassEx(&wcex))
{
MessageBox(NULL,
_T("Call to RegisterClassEx failed!"),
_T("Windows Desktop Guided Tour"),
NULL);
return 1;
}
hInst = hInstance;
HWND hWnd = CreateWindow(
szWindowClass,
szTitle,
WS_OVERLAPPEDWINDOW, 500, 500, 500, 500,
//CW_USEDEFAULT, CW_USEDEFAULT,
//CW_USEDEFAULT, CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL
);
if (!hWnd)
{
MessageBox(NULL,
_T("Call to CreateWindow failed!"),
_T("Windows Desktop Guided Tour"),
NULL);
return 1;
}
InitBezierParams(); // Chemam functia care initializeaza pentru prima data punctele
curbei Bezier
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int)msg.wParam;
}
// functia care initializeaza punctele
void InitBezierParams()
{
}
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
TCHAR greeting[] = _T("Curba Besier prin functii GDI");
TCHAR greeting_1[] = _T("Curba Besier, prin formule matematice");
bool fDraw = FALSE;
POINT ptPrevious = { 0,0 };
switch (message)
{
case WM_KEYDOWN:
}
}
else {
switch (wParam)
{
case VK_LEFT:
apt[1].x -= 10;
break;
case VK_RIGHT:
apt[1].x += 6;
break;
case VK_UP:
apt[1].y -= 10;
break;
case VK_DOWN:
apt[1].y += 6;
break;
}
}
}
}
InvalidateRect(hWnd, NULL, TRUE);
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
SetTextColor(hdc, RGB(0, 30, 70));
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 20, 20, greeting, _tcslen(greeting));
TextOut(hdc, 20, 150, greeting_1, _tcslen(greeting_1));
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}