commit 5b31734a5ca630e2d8b16a8a278cd95c07204ba5 Author: bMorgan01 Date: Thu Aug 27 21:52:14 2020 -0600 init commit diff --git a/.vs/WebinarsGUI/v16/.suo b/.vs/WebinarsGUI/v16/.suo new file mode 100644 index 0000000..b8ecbe0 Binary files /dev/null and b/.vs/WebinarsGUI/v16/.suo differ diff --git a/.vs/WebinarsGUI/v16/Browse.VC.db b/.vs/WebinarsGUI/v16/Browse.VC.db new file mode 100644 index 0000000..dafacdc Binary files /dev/null and b/.vs/WebinarsGUI/v16/Browse.VC.db differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/16e649092a7b24f/IDD_DIALOG1.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/16e649092a7b24f/IDD_DIALOG1.ipch new file mode 100644 index 0000000..ba5b10d Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/16e649092a7b24f/IDD_DIALOG1.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/2727f96d79d1552d/MAIN.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/2727f96d79d1552d/MAIN.ipch new file mode 100644 index 0000000..ea91b90 Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/2727f96d79d1552d/MAIN.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/3b4c3970b3da262f/ADDDIALOG.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/3b4c3970b3da262f/ADDDIALOG.ipch new file mode 100644 index 0000000..3e9785f Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/3b4c3970b3da262f/ADDDIALOG.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/676c7029472e2718/MAIN.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/676c7029472e2718/MAIN.ipch new file mode 100644 index 0000000..c78e322 Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/676c7029472e2718/MAIN.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/8caf6e854937706a/BUTTON.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/8caf6e854937706a/BUTTON.ipch new file mode 100644 index 0000000..070e59d Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/8caf6e854937706a/BUTTON.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/909658cf50296bab/MAIN.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/909658cf50296bab/MAIN.ipch new file mode 100644 index 0000000..184fe37 Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/909658cf50296bab/MAIN.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/9dac869e187e80aa/WEBINARSGUI.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/9dac869e187e80aa/WEBINARSGUI.ipch new file mode 100644 index 0000000..731f4fa Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/9dac869e187e80aa/WEBINARSGUI.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/aba9b85de6112ae0/WEBINARSGUI.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/aba9b85de6112ae0/WEBINARSGUI.ipch new file mode 100644 index 0000000..ea7bdf5 Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/aba9b85de6112ae0/WEBINARSGUI.ipch differ diff --git a/.vs/WebinarsGUI/v16/ipch/AutoPCH/ee583d77e554c1f2/MAIN.ipch b/.vs/WebinarsGUI/v16/ipch/AutoPCH/ee583d77e554c1f2/MAIN.ipch new file mode 100644 index 0000000..4657d85 Binary files /dev/null and b/.vs/WebinarsGUI/v16/ipch/AutoPCH/ee583d77e554c1f2/MAIN.ipch differ diff --git a/Debug/WebinarsGUI.exe b/Debug/WebinarsGUI.exe new file mode 100644 index 0000000..8f3494f Binary files /dev/null and b/Debug/WebinarsGUI.exe differ diff --git a/Debug/WebinarsGUI.ilk b/Debug/WebinarsGUI.ilk new file mode 100644 index 0000000..1ea3f0a Binary files /dev/null and b/Debug/WebinarsGUI.ilk differ diff --git a/Debug/WebinarsGUI.pdb b/Debug/WebinarsGUI.pdb new file mode 100644 index 0000000..e5038a9 Binary files /dev/null and b/Debug/WebinarsGUI.pdb differ diff --git a/WebinarsGUI.sln b/WebinarsGUI.sln new file mode 100644 index 0000000..1b818ba --- /dev/null +++ b/WebinarsGUI.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30413.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebinarsGUI", "WebinarsGUI\WebinarsGUI.vcxproj", "{82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Debug|x64.ActiveCfg = Debug|x64 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Debug|x64.Build.0 = Debug|x64 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Debug|x86.ActiveCfg = Debug|Win32 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Debug|x86.Build.0 = Debug|Win32 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Release|x64.ActiveCfg = Release|x64 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Release|x64.Build.0 = Release|x64 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Release|x86.ActiveCfg = Release|Win32 + {82DC6DD0-9608-4F24-BC4E-8FFC58C663EC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7537BD79-B661-40C6-93C3-4BBAE45EEF30} + EndGlobalSection +EndGlobal diff --git a/WebinarsGUI/AddDialog.cpp b/WebinarsGUI/AddDialog.cpp new file mode 100644 index 0000000..e69de29 diff --git a/WebinarsGUI/AddDialog.h b/WebinarsGUI/AddDialog.h new file mode 100644 index 0000000..e69de29 diff --git a/WebinarsGUI/Button.cpp b/WebinarsGUI/Button.cpp new file mode 100644 index 0000000..b079d40 --- /dev/null +++ b/WebinarsGUI/Button.cpp @@ -0,0 +1 @@ +#include "Button.h" diff --git a/WebinarsGUI/Button.h b/WebinarsGUI/Button.h new file mode 100644 index 0000000..ddb7d6a --- /dev/null +++ b/WebinarsGUI/Button.h @@ -0,0 +1,10 @@ +#pragma once +#include "framework.h" +#include + +class Button { +public: + std::wstring name; + HWND wnd; + std::wstring cmd; +}; \ No newline at end of file diff --git a/WebinarsGUI/Debug/Button.obj b/WebinarsGUI/Debug/Button.obj new file mode 100644 index 0000000..bd9ff13 Binary files /dev/null and b/WebinarsGUI/Debug/Button.obj differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.exe.recipe b/WebinarsGUI/Debug/WebinarsGUI.exe.recipe new file mode 100644 index 0000000..9999161 --- /dev/null +++ b/WebinarsGUI/Debug/WebinarsGUI.exe.recipe @@ -0,0 +1,7 @@ + + + C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\Debug\WebinarsGUI.exe + + + + \ No newline at end of file diff --git a/WebinarsGUI/Debug/WebinarsGUI.log b/WebinarsGUI/Debug/WebinarsGUI.log new file mode 100644 index 0000000..1783a17 --- /dev/null +++ b/WebinarsGUI/Debug/WebinarsGUI.log @@ -0,0 +1,11 @@ + WebinarsGUI.cpp +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(168,52): warning C4018: '>': signed/unsigned mismatch +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(236,20): warning C4101: 'hBrush': unreferenced local variable +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(416,49): warning C4018: '>': signed/unsigned mismatch +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(300,9): warning C4101: 'hdc': unreferenced local variable +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(298,11): warning C4101: 'hFont': unreferenced local variable +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(299,10): warning C4101: 'hctl': unreferenced local variable +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(449,27): warning C4018: '<': signed/unsigned mismatch +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(471,31): warning C4018: '<': signed/unsigned mismatch +C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\WebinarsGUI\WebinarsGUI.cpp(504,39): warning C4018: '<': signed/unsigned mismatch + WebinarsGUI.vcxproj -> C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\Debug\WebinarsGUI.exe diff --git a/WebinarsGUI/Debug/WebinarsGUI.obj b/WebinarsGUI/Debug/WebinarsGUI.obj new file mode 100644 index 0000000..f1ec822 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.obj differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.res b/WebinarsGUI/Debug/WebinarsGUI.res new file mode 100644 index 0000000..f1495c7 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.res differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.command.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.command.1.tlog new file mode 100644 index 0000000..fbd4e9c Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.command.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.read.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.read.1.tlog new file mode 100644 index 0000000..79d40e6 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.read.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.write.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.write.1.tlog new file mode 100644 index 0000000..5bfaa17 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/CL.write.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/WebinarsGUI.lastbuildstate b/WebinarsGUI/Debug/WebinarsGUI.tlog/WebinarsGUI.lastbuildstate new file mode 100644 index 0000000..8cfdee8 --- /dev/null +++ b/WebinarsGUI/Debug/WebinarsGUI.tlog/WebinarsGUI.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.27.29110:TargetPlatformVersion=10.0.18362.0: +Debug|Win32|C:\Users\benmo\Desktop\Ben\Projects\Programs\Cpp\WebinarsGUI\WebinarsGUI\| diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/link.command.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/link.command.1.tlog new file mode 100644 index 0000000..6ac2afb Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/link.command.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/link.read.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/link.read.1.tlog new file mode 100644 index 0000000..f52ca40 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/link.read.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/link.write.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/link.write.1.tlog new file mode 100644 index 0000000..4566e05 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/link.write.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.command.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.command.1.tlog new file mode 100644 index 0000000..52ff0af Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.command.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.read.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.read.1.tlog new file mode 100644 index 0000000..aa6d7c3 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.read.1.tlog differ diff --git a/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.write.1.tlog b/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.write.1.tlog new file mode 100644 index 0000000..e38f802 Binary files /dev/null and b/WebinarsGUI/Debug/WebinarsGUI.tlog/rc.write.1.tlog differ diff --git a/WebinarsGUI/Debug/vc142.idb b/WebinarsGUI/Debug/vc142.idb new file mode 100644 index 0000000..e5da1bb Binary files /dev/null and b/WebinarsGUI/Debug/vc142.idb differ diff --git a/WebinarsGUI/Debug/vc142.pdb b/WebinarsGUI/Debug/vc142.pdb new file mode 100644 index 0000000..09fc25a Binary files /dev/null and b/WebinarsGUI/Debug/vc142.pdb differ diff --git a/WebinarsGUI/WebinarsGUI.aps b/WebinarsGUI/WebinarsGUI.aps new file mode 100644 index 0000000..50c644f Binary files /dev/null and b/WebinarsGUI/WebinarsGUI.aps differ diff --git a/WebinarsGUI/WebinarsGUI.cpp b/WebinarsGUI/WebinarsGUI.cpp new file mode 100644 index 0000000..d89c25c --- /dev/null +++ b/WebinarsGUI/WebinarsGUI.cpp @@ -0,0 +1,515 @@ +// WebinarsGUI.cpp : Defines the entry point for the application. +// + +#include "WebinarsGUI.h" +#include "Button.h" +#include +#include +#include +#include + +#define MAX_LOADSTRING 100 + +// Global Variables: +HINSTANCE hInst; // current instance +WCHAR szTitle[MAX_LOADSTRING]; // The title bar text +WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name +HWND hWnd; + +int width = 200, height = 300; + +std::vector classes; + +std::vector split(const std::wstring& str, const std::wstring& delim) +{ + std::vector tokens; + size_t prev = 0, pos = 0; + do + { + pos = str.find(delim, prev); + if (pos == std::wstring::npos) pos = str.length(); + std::wstring token = str.substr(prev, pos - prev); + if (!token.empty()) tokens.push_back(token); + prev = pos + delim.length(); + } while (pos < str.length() && prev < str.length()); + return tokens; +} + +// 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 Add(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK Remove(HWND, UINT, WPARAM, LPARAM); + +int APIENTRY wWinMain(_In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPWSTR lpCmdLine, + _In_ int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + // TODO: Place code here. + + // Initialize global strings + LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadStringW(hInstance, IDC_WEBINARSGUI, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance); + + // Perform application initialization: + if (!InitInstance (hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WEBINARSGUI)); + + MSG msg; + + // Main message loop: + while (GetMessage(&msg, nullptr, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + +// +// FUNCTION: MyRegisterClass() +// +// PURPOSE: Registers the window class. +// +ATOM MyRegisterClass(HINSTANCE hInstance) +{ + 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.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WEBINARSGUI)); + wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_WEBINARSGUI); + wcex.lpszClassName = szWindowClass; + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_WEBINARSGUI)); + + return RegisterClassExW(&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) +{ + hInst = hInstance; // Store instance handle in our global variable + + hWnd = CreateWindowW(szWindowClass, szTitle, (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_BORDER), + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr); + + int h, v; + GetDesktopResolution(h, v); + MoveWindow(hWnd, (h-width)/2, (v-height)/2, width + 15, height, true); + + if (!hWnd) + { + return FALSE; + } + + std::wstring name, code, pass; + std::wifstream fin("classes.txt"); + if (fin.is_open()) { + do { + std::wstring line; + getline(fin, line); + + std::vector res = split(line, L"|"); + if (res.size() >= 2) { + name = res[0]; + code = res[1]; + if (res.size() == 3) pass = res[2]; + + classes.push_back(new Button); + classes[classes.size() - 1]->cmd = LR"(%APPDATA%\Zoom\bin\Zoom.exe "--url=zoommtg://zoom.us/join?action=join&confno=)" + code; + if (res.size() == 3) classes[classes.size() - 1]->cmd += LR"(&pwd=)" + pass; + classes[classes.size() - 1]->name = name; + classes[classes.size() - 1]->wnd = CreateWindow( + L"BUTTON", // Predefined class; Unicode assumed + (LPCWSTR)name.c_str(), // Button text + WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, // Styles + (width - 100) / 2, // x position + 75 + 35 * (classes.size() - 1), // y position + 100, // Button width + 25, // Button height + hWnd, // Parent window + NULL, // No menu. + (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE), + NULL); // Pointer not needed. + + if (175 + 35 * (classes.size() - 1) > height) { + height += 35; + MoveWindow(hWnd, (h - width) / 2, (v - 300) / 2, width + 15, height, true); + } + } + } while (!fin.eof()); + } + fin.close(); + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + for (Button* b : classes) { + ShowWindow(b->wnd, nCmdShow); + UpdateWindow(b->wnd); + } + + 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) +{ + switch (message) + { + case WM_COMMAND: + { + int wmId = LOWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case BN_CLICKED: + for (Button* b : classes) { + if ((HWND)lParam == b->wnd) _wsystem(b->cmd.c_str()); + } + + PostQuitMessage(0); + + break; + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case ID_FILE_ADDCLASS: + DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG1), hWnd, Add); + break; + case ID_FILE_REMOVECLASS: + DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG2), hWnd, Remove); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + } + break; + case WM_PAINT: + { + RECT rect; + HBRUSH hBrush; + HFONT hFont; + + PAINTSTRUCT ps; + HDC hdc = BeginPaint(hWnd, &ps); + + //Logical units are device dependent pixels, so this will create a handle to a logical font that is 48 pixels in height. + //The width, when set to 0, will cause the font mapper to choose the closest matching value. + //The font face name will be Impact. + hFont = CreateFont(36, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_OUTLINE_PRECIS, + CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, VARIABLE_PITCH, TEXT("Impact")); + SelectObject(hdc, hFont); + + //Sets the coordinates for the rectangle in which the text is to be formatted. + SetRect(&rect, 0, 15, 200, 290); + SetTextColor(hdc, RGB(0, 0, 0)); + DrawText(hdc, TEXT("Webinar Links"), -1, &rect, DT_CENTER); + + 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; +} + +// Message handler for about box. +INT_PTR CALLBACK Add(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + TCHAR lpszCode[MAX_LOADSTRING]; + WORD cchCode; + + TCHAR lpszPass[MAX_LOADSTRING]; + WORD cchPass; + + TCHAR lpszName[MAX_LOADSTRING]; + WORD cchName; + + HFONT hFont; + HWND hctl; + HDC hdc; + + UNREFERENCED_PARAMETER(lParam); + switch (message) + { + case WM_INITDIALOG: + return (INT_PTR)TRUE; + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + cchCode = (WORD)SendDlgItemMessage(hDlg, + IDC_EDIT1, + EM_LINELENGTH, + (WPARAM)0, + (LPARAM)0); + + if (cchCode == 0) + { + MessageBox(hDlg, + L"No room code entered.", + L"Error", + MB_OK); + + EndDialog(hDlg, TRUE); + return FALSE; + } + + // Put the number of characters into first word of buffer. + *((LPWORD)lpszCode) = cchCode; + + // Get the characters. + SendDlgItemMessage(hDlg, + IDC_EDIT1, + EM_GETLINE, + (WPARAM)0, // line 0 + (LPARAM)lpszCode); + + // Null-terminate the string. + lpszCode[cchCode] = 0; + + cchPass = (WORD)SendDlgItemMessage(hDlg, + IDC_EDIT2, + EM_LINELENGTH, + (WPARAM)0, + (LPARAM)0); + + if (cchPass == 0) + { + if (MessageBox(hDlg, + L"Are you sure this room has no password?", + L"No characters entered.", + MB_YESNO) == IDNO) { + + return FALSE; + } + } + + // Put the number of characters into first word of buffer. + *((LPWORD)lpszPass) = cchPass; + + // Get the characters. + SendDlgItemMessage(hDlg, + IDC_EDIT2, + EM_GETLINE, + (WPARAM)0, // line 0 + (LPARAM)lpszPass); + + // Null-terminate the string. + lpszPass[cchPass] = 0; + + cchName = (WORD)SendDlgItemMessage(hDlg, + IDC_EDIT3, + EM_LINELENGTH, + (WPARAM)0, + (LPARAM)0); + + if (cchName == 0) + { + MessageBox(hDlg, + L"No name entered.", + L"Error", + MB_OK); + + EndDialog(hDlg, TRUE); + return FALSE; + } + + // Put the number of characters into first word of buffer. + *((LPWORD)lpszName) = cchName; + + // Get the characters. + SendDlgItemMessage(hDlg, + IDC_EDIT3, + EM_GETLINE, + (WPARAM)0, // line 0 + (LPARAM)lpszName); + + // Null-terminate the string. + lpszName[cchName] = 0; + + classes.push_back(new Button); + classes[classes.size() - 1]->cmd = LR"(%APPDATA%\Zoom\bin\Zoom.exe "--url=zoommtg://zoom.us/join?action=join&confno=)" + (std::wstring)lpszCode + LR"(&pwd=)" + (std::wstring)lpszPass; + classes[classes.size() - 1]->name = lpszName; + classes[classes.size() - 1]->wnd = CreateWindow( + L"BUTTON", // Predefined class; Unicode assumed + lpszName, // Button text + WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, // Styles + (width - 100) / 2, // x position + 75 + 35*(classes.size() -1), // y position + 100, // Button width + 25, // Button height + hWnd, // Parent window + NULL, // No menu. + (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE), + NULL); // Pointer not needed. + + if (175 + 35 * (classes.size() - 1) > height) { + height += 35; + int h, v; + GetDesktopResolution(h, v); + MoveWindow(hWnd, (h - width) / 2, (v - 300) / 2, width + 15, height, true); + } + + std::wofstream fout("classes.txt", std::ios::app); + fout << std::wstring(lpszName) << "|" << std::wstring(lpszCode) << "|" << std::wstring(lpszPass) << std::endl; + fout.close(); + + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + else if (LOWORD(wParam) == IDCANCEL) { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} + +// Message handler for about box. +INT_PTR CALLBACK Remove(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + HWND hwndList = GetDlgItem(hDlg, IDC_COMBO2); + + switch (message) + { + case WM_INITDIALOG: + // Add items to list. + for (int i = 0; i < classes.size(); i++) + { + int pos = (int)SendMessage(hwndList, CB_ADDSTRING, 0, + (LPARAM)classes[i]->name.c_str()); + // Set the array index of the player as item data. + // This enables us to retrieve the item from the array + // even after the items are sorted by the list box. + SendMessage(hwndList, CB_SETITEMDATA, pos, (LPARAM)i); + } + // Set input focus to the list box. + SetFocus(hwndList); + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + int ItemIndex = SendMessage(hwndList, (UINT)CB_GETCURSEL, + (WPARAM)0, (LPARAM)0); + TCHAR ListItem[256]; + (TCHAR)SendMessage(hwndList, (UINT)CB_GETLBTEXT, + (WPARAM)ItemIndex, (LPARAM)ListItem); + + for (int i = 0; i < classes.size(); i++) { + if (classes[i]->name == ListItem) { + std::wstring line; + std::wifstream fin; + + fin.open("classes.txt"); + // contents of path must be copied to a temp file then + // renamed back to the path file + std::wofstream temp; + temp.open("temp.txt"); + + while (getline(fin, line)) { + // write all lines to temp other than the line marked for erasing + if (line.find(classes[i]->name) == std::wstring::npos) + temp << line << std::endl; + } + + temp.close(); + fin.close(); + + remove("classes.txt"); + rename("temp.txt", "classes.txt"); + + DestroyWindow(classes[i]->wnd); + classes.erase(classes.begin() + i); + + if (height - 35 > 300) { + height -= 35; + int h, v; + GetDesktopResolution(h, v); + MoveWindow(hWnd, (h - width) / 2, (v - 300) / 2, width + 15, height, true); + } + + for (int j = i; j < classes.size(); j++) MoveWindow(classes[j]->wnd, (width - 100) / 2, 75 + 35 * j, 100, 25, true); + } + } + + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } else if (LOWORD(wParam) == IDCANCEL) { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} \ No newline at end of file diff --git a/WebinarsGUI/WebinarsGUI.h b/WebinarsGUI/WebinarsGUI.h new file mode 100644 index 0000000..62261ab --- /dev/null +++ b/WebinarsGUI/WebinarsGUI.h @@ -0,0 +1,19 @@ +#pragma once + +#include "resource.h" +#include "framework.h" + +// Get the horizontal and vertical screen sizes in pixel +void GetDesktopResolution(int& horizontal, int& vertical) +{ + RECT desktop; + // Get a handle to the desktop window + const HWND hDesktop = GetDesktopWindow(); + // Get the size of screen to the variable desktop + GetWindowRect(hDesktop, &desktop); + // The top left corner will have coordinates (0,0) + // and the bottom right corner will have coordinates + // (horizontal, vertical) + horizontal = desktop.right; + vertical = desktop.bottom; +} \ No newline at end of file diff --git a/WebinarsGUI/WebinarsGUI.ico b/WebinarsGUI/WebinarsGUI.ico new file mode 100644 index 0000000..a4a16bc Binary files /dev/null and b/WebinarsGUI/WebinarsGUI.ico differ diff --git a/WebinarsGUI/WebinarsGUI.rc b/WebinarsGUI/WebinarsGUI.rc new file mode 100644 index 0000000..64b4fae Binary files /dev/null and b/WebinarsGUI/WebinarsGUI.rc differ diff --git a/WebinarsGUI/WebinarsGUI.vcxproj b/WebinarsGUI/WebinarsGUI.vcxproj new file mode 100644 index 0000000..9dd8654 --- /dev/null +++ b/WebinarsGUI/WebinarsGUI.vcxproj @@ -0,0 +1,161 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {82dc6dd0-9608-4f24-bc4e-8ffc58c663ec} + WebinarsGUI + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + true + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebinarsGUI/WebinarsGUI.vcxproj.filters b/WebinarsGUI/WebinarsGUI.vcxproj.filters new file mode 100644 index 0000000..eda78c2 --- /dev/null +++ b/WebinarsGUI/WebinarsGUI.vcxproj.filters @@ -0,0 +1,52 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Resource Files + + + + + Source Files + + + Source Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/WebinarsGUI/WebinarsGUI.vcxproj.user b/WebinarsGUI/WebinarsGUI.vcxproj.user new file mode 100644 index 0000000..5df420f --- /dev/null +++ b/WebinarsGUI/WebinarsGUI.vcxproj.user @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/WebinarsGUI/classes.txt b/WebinarsGUI/classes.txt new file mode 100644 index 0000000..acbb54a --- /dev/null +++ b/WebinarsGUI/classes.txt @@ -0,0 +1,5 @@ +Calc III|98580136167|Y1ZTL3B4R2pkcEJBY3NGQ01hVE84dz09 +Comp Org|94871087494|OVBqUmpsTDBsdHBzZUZpWEdUNGhzZz09 +Chem Lecture|91392749032|dmtYcHlsSWtXN0FxaWRWbGFvWE1kUT09 +HASS|99597782963|V2NqSkVPWDBKRXgrSmF5MythSHordz09 +Personal|3852473325| diff --git a/WebinarsGUI/framework.h b/WebinarsGUI/framework.h new file mode 100644 index 0000000..5519781 --- /dev/null +++ b/WebinarsGUI/framework.h @@ -0,0 +1,17 @@ +// header.h : include file for standard system include files, +// or project specific include files +// + +#pragma once + +#include "targetver.h" +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files +#include +// C RunTime Header Files +#include +#include +#include +#include +// C++ Headers +#include diff --git a/WebinarsGUI/resource.h b/WebinarsGUI/resource.h new file mode 100644 index 0000000..9adf2f5 --- /dev/null +++ b/WebinarsGUI/resource.h @@ -0,0 +1,34 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by WebinarsGUI.rc +// +#define IDC_MYICON 2 +#define IDD_WEBINARSGUI_DIALOG 102 +#define IDS_APP_TITLE 103 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_WEBINARSGUI 107 +#define IDC_WEBINARSGUI 109 +#define IDR_MAINFRAME 128 +#define IDD_DIALOG1 130 +#define IDD_DIALOG2 131 +#define IDC_EDIT1 1000 +#define IDC_EDIT2 1001 +#define IDC_EDIT3 1002 +#define IDC_COMBO2 1004 +#define ID_FILE_ADDCLASS 32771 +#define ID_FILE_REMOVECLASS 32772 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 134 +#define _APS_NEXT_COMMAND_VALUE 32774 +#define _APS_NEXT_CONTROL_VALUE 1009 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/WebinarsGUI/targetver.h b/WebinarsGUI/targetver.h new file mode 100644 index 0000000..bf75e08 --- /dev/null +++ b/WebinarsGUI/targetver.h @@ -0,0 +1,6 @@ +#pragma once + +// // Including SDKDDKVer.h defines the highest available Windows platform. +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. +#include