NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// test2kstaeo.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "test2kstaeo.h"

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name

// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK Prozorec(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK Timer1(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_TEST2KSTAEO, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_TEST2KSTAEO));

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

return (int) msg.wParam;
}



//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage are only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TEST2KSTAEO));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_TEST2KSTAEO);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

return RegisterClassEx(&wcex);
}

//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;

hInst = hInstance; // Store instance handle in our global variable

hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

if (!hWnd)
{
return FALSE;
}

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

return TRUE;
}

//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
HPEN hPen1;

switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case ID_DIALOGS_PROZOREC:
DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG1), hWnd, Prozorec);
break;
case ID_DIALOGS_TIMER:
DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG2), hWnd, Timer1);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...

hPen1 = CreatePen(PS_SOLID, 2, RGB(0, 0, 0));
SelectObject(hdc, hPen1);
Rectangle(hdc, 50, 50, 200, 200);
Ellipse(hdc, 50, 25, 200, 75);
Ellipse(hdc, 50, 175, 200, 225);

EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

// Message handler for about box.
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:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}

INT_PTR CALLBACK Prozorec(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
int c1_index, c2_index;
char edit1[100], edit2[100], edit3[100];
double a, b, c;

UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}

if (LOWORD(wParam) == IDC_BUTTON2)
{
GetDlgItemText(hDlg, IDC_EDIT1, edit1, 100);
GetDlgItemText(hDlg, IDC_EDIT2, edit2, 100);

if(!(SendDlgItemMessage(hDlg, IDC_COMBO1 ,CB_FINDSTRING, 0, (LPARAM) edit1)>-1))
{
c1_index=SendDlgItemMessage(hDlg, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM) edit1);
SendDlgItemMessage(hDlg, IDC_COMBO1, CB_SETCURSEL, c1_index, 0);
}

if(!(SendDlgItemMessage(hDlg, IDC_COMBO2, CB_FINDSTRING, 0, (LPARAM) edit2)<-1))
{
c2_index=SendDlgItemMessage(hDlg, IDC_COMBO2, CB_ADDSTRING, 0, (LPARAM) edit2);
SendDlgItemMessage(hDlg, IDC_COMBO2, CB_SETCURSEL, c2_index, 0);
}
}

if (LOWORD(wParam) == IDC_BUTTON1)
{
char *stopstring;

if (IsDlgButtonChecked(hDlg, IDC_CHECK1) && IsDlgButtonChecked(hDlg, IDC_CHECK2) && IsDlgButtonChecked(hDlg, IDC_CHECK3))
{
GetDlgItemText(hDlg, IDC_EDIT1, edit1, 100);
GetDlgItemText(hDlg, IDC_EDIT2, edit2, 100);
GetDlgItemText(hDlg, IDC_EDIT3, edit3, 100);

b = strtod(edit1, &stopstring);
c = strtod(edit2, &stopstring);
a = strtod(edit3, &stopstring);

gcvt((b*c-a), 10, edit3);

SetDlgItemText(hDlg, IDC_EDIT4, edit3);
}
}
break;
}
return (INT_PTR)FALSE;
}

INT_PTR CALLBACK Timer1(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
#define TIMER1 500
int counter;

UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}

if (LOWORD(wParam) == IDC_BUTTON1)
{
SetTimer(hDlg, TIMER1, 20, NULL);
}
break;

case WM_TIMER:
{ counter = GetDlgItemInt(hDlg, IDC_EDIT1, NULL, FALSE);

if (counter == 100)
{
KillTimer(hDlg, TIMER1);
if (MessageBox(hDlg, "Would you like to stop?", "Info", MB_YESNO) == IDNO)
{
SetTimer(hDlg, TIMER1, 20, NULL);
} else {
counter = 0;
}
}

counter+=5;
SetDlgItemInt(hDlg, IDC_EDIT1, counter, NULL);
}
break;
}
return (INT_PTR)FALSE;



}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.