#Include: "Test - Ppe.h"
#Include: "Test - Ppe.h"
#Include: "Test - Ppe.h"
h"
#include <string>
#include <stdlib.h>
#include "test_ppe.h"
#include <iostream>
#include <sstream>
#include <windows.h>
int sec = 0;
int minute = 0;
int ore = 0;
HWND hquest, hOut, hINTREB1, hINTREB2, hRadio1, hRadio2, hCheckBox1, hCheckBox2, hCheckBox3,
hCheckBox4;
//VARIABILE GLOBALE
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);//este funcția care va trata mesajele
pentru această clasă de ferestre
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance(hInstance, nCmdShow))
return FALSE;
MSG msg;
TranslateMessage(&msg);
DispatchMessage(&msg);
return (int)msg.wParam;
WNDCLASSEXW wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_BUTTONSTIMER);
wcex.lpszClassName = szWindowClass;
return RegisterClassExW(&wcex);
hInst = hInstance; //
if (!hWnd)
return FALSE;
return TRUE;
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
PAINTSTRUCT ps;
switch (message)
case WM_CREATE:
CreareTest(hWnd);
break;
case WM_PAINT:
EndPaint(hWnd, &ps);
}
break;
case WM_COMMAND:
switch (wmId)
case IDM_ABOUT:
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
case SUBMIT_BUTTON:
//INTREB 2
//radioButtons
//verificare daca a fost selectata vreo varianta de raspuns pentru butoane radio
spatiuCompletat = false;
raspunsCorrect = false;
//checkboxes
if (
raspunsCorrect = false;
//INTREB 1
if (draspuns1 != 4) {
raspunsCorrect = false;
//INTREB 2
if (draspuns2 != 2) {
raspunsCorrect = false;
if (time <= 0) {
else if (!spatiuCompletat) {
else if (!raspunsCorrect) {
SetWindowTextA(hOut, out);
//AddControls(hWnd);
break;
case IDB_RADIO1:
switch (HIWORD(wParam))
case BN_CLICKED:
break;
break;
case IDB_RADIO2:
switch (HIWORD(wParam))
case BN_CLICKED:
break;
break;
default:
break;
case WM_TIMER://setarea timpului pentru ceas care va creste pina la finisarea timpului
preconuzat pentru test
if (time >= 0)
time++;
SetTime(hWnd);
else {
KillTimer(hWnd, IDT_TIMER);
break;
}
break;
case WM_DESTROY:
KillTimer(hWnd, IDT_TIMER);
PostQuitMessage(0);
break;
default:
return 0;
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
UNREFERENCED_PARAMETER(lParam);
switch (message)
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
break;
return (INT_PTR)FALSE;
pointNume.x = 210;
pointNume.y = 1;
char timeString[100];
//uses an string stream to create time string then uses it to output to user
std::wstringstream remainingTime;
remainingTime << "Timp Ramas: " << ore << " : " << minute << " : " << sec;
if (time == 60)
{
time = -59;
SetWindowTextA(hOut, out);
POINT pointNume;
pointNume.x = 10;
pointNume.y = 10;
pointNume.y += (double)labelHeigth;
hCheckBox1 = CreateWindowEx(0, L"BUTTON", L"Mouse-ul", WS_VISIBLE | WS_CHILD |
BS_AUTOCHECKBOX, pointNume.x, pointNume.y, labelWidth, labelHeigth, hWnd,
(HMENU)IDB_CHECKBOX2, NULL, NULL);
pointNume.y += (double)labelHeigth;
pointNume.y += (double)labelHeigth;
pointNume.y += (double)labelHeigth;
//RadioButtons
pointNume.y += (double)labelHeigth;
//ChackBoxes
CreateWindowW(L"Static", L"Unul din parametrii functiei WinMain", WS_VISIBLE |
WS_CHILD, pointNume.x, pointNume.y, labelWidth, labelHeigth, hWnd, NULL, NULL, NULL);
pointNume.y += (double)labelHeigth;
pointNume.y += (double)labelHeigth;