Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "form.h"
- #include <iostream>
- #include <vector>
- #include <iterator>
- #include <string>
- #include <sstream>
- #include <fstream>
- #include <stdlib.h>
- #include <tchar.h>
- #include <algorithm>
- #include <Commctrl.h>
- #pragma comment(lib, "Comctl32.lib")
- using namespace std;
- HWND ParentWindow = NULL;
- HWND MainWindow = NULL;
- WNDCLASSEX nClass;
- HMENU WindowMenu = NULL;
- HMODULE HInstance = NULL;
- HWND InputField = NULL;
- HWND ConsoleField = NULL;
- HWND hWndComboBox;
- HWND SecondWindow = NULL;
- HWND ConsoleField2;
- BOOL Ressetteminal();
- LRESULT CALLBACK DLLWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message)
- {
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case CREDITS:
- MessageBox(hwnd, "Credits goes to YOU and https://www.youtube.com/channel/UCduLFy4X1gDj_n1R4VxXkaA", "Credits", MB_OKCANCEL);
- break;
- case COMMANDS:
- HandleCommand("cmds");
- break;
- case ABOUT:
- MessageBox(hwnd, "This is an exploit called Layout Source!", "About", MB_OKCANCEL);
- break;
- case INPUT_FIELD:
- if (HIWORD(wParam) == EN_MAXTEXT) {
- char cText[INPUT_CHAR_LIMIT];
- SendMessage((HWND)lParam, WM_GETTEXT, INPUT_CHAR_LIMIT, (LPARAM)cText);
- if (strcmp(cText, "") == 0)
- break;
- SendMessage((HWND)lParam, WM_SETTEXT, NULL, (LPARAM)"");
- //std::string command = cText;
- HandleCommand(cText);
- }
- break;
- }
- break;
- case WM_DESTROY:
- ExitThread(0);
- break;
- case WM_QUIT:
- ExitThread(0);
- break;
- default:
- return DefWindowProc(hwnd, message, wParam, lParam);
- }
- return 0;
- }
- BOOL RegisterWindowClass(const char* wClassName) {
- nClass.cbSize = sizeof(WNDCLASSEX);
- nClass.style = CS_DBLCLKS;
- nClass.lpfnWndProc = DLLWindowProc;
- nClass.cbClsExtra = 0;
- nClass.cbWndExtra = 0;
- nClass.hInstance = GetModuleHandle(NULL);
- nClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
- nClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
- nClass.hCursor = LoadCursor(NULL, IDC_ARROW);
- nClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
- nClass.lpszMenuName = "what";
- nClass.lpszClassName = wClassName;
- if (!RegisterClassEx(&nClass))
- return 0;
- return 1;
- }
- BOOL Ressetteminal() {
- //HINSTANCE hInstance = GetModuleHandle(NULL);
- DestroyWindow(ConsoleField2);
- ConsoleField2 = CreateWindowEx(NULL, "EDIT", "", WS_CHILD | WS_BORDER | WS_VSCROLL | ES_MULTILINE | WS_VISIBLE | ES_READONLY | ES_AUTOVSCROLL, 10, 20, 520, 375, SecondWindow, (HMENU)CONSOLE_WINDOW, HInstance, 0);
- UpdateWindow(MainWindow);
- return 1;
- }
- BOOL CreateSubwindows() {
- //HINSTANCE hInstance = GetModuleHandle(NULL);
- ConsoleField = CreateWindowEx(NULL, "EDIT", "", WS_CHILD | WS_BORDER | WS_VSCROLL | ES_MULTILINE | WS_VISIBLE | ES_READONLY | ES_AUTOVSCROLL, 10, 20, 520, 375, MainWindow, (HMENU)CONSOLE_WINDOW, HInstance, 0);
- HWND consoleFieldLabel = CreateWindowEx(NULL, "STATIC", "", WS_CHILD | WS_VISIBLE, 10, 0, 100, 20, MainWindow, NULL, HInstance, NULL);
- InputField = CreateWindowEx(NULL, "EDIT", "", WS_CHILD | WS_BORDER | ES_MULTILINE | WS_VISIBLE, 10, 425, 500, 20, MainWindow, (HMENU)INPUT_FIELD, HInstance, 0);
- HWND inputFieldLabel = CreateWindowEx(NULL, "STATIC", "", WS_CHILD | WS_VISIBLE, 10, 400, 60, 20, MainWindow, NULL, HInstance, NULL);
- SendMessage(inputFieldLabel, WM_SETTEXT, NULL, (LPARAM)"Input");
- SendMessage(consoleFieldLabel, WM_SETTEXT, NULL, (LPARAM)"Console");
- SendMessage(InputField, EM_SETLIMITTEXT, INPUT_CHAR_LIMIT, NULL);
- //WaypointBox = CreateWindowEx(NULL, "LISTBOX", "", WS_CHILD | WS_BORDER | WS_VSCROLL | WS_VISIBLE, 10, 280, 520, 100, MainWindow, (HMENU)ALX_WAYPOINT_BOX, HInstance, 0);
- //SendMessage(WaypointBox, LVM_SETITEMTEXT, )
- HFONT textFont = CreateFont(18, 0, 0, 0, FW_LIGHT, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, VARIABLE_PITCH, TEXT("Segoe UI"));
- SendMessage(inputFieldLabel, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- SendMessage(consoleFieldLabel, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- SendMessage(ConsoleField, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- SendMessage(InputField, WM_SETFONT, (WPARAM)textFont, MAKELPARAM(TRUE, 0));
- UpdateWindow(MainWindow);
- return 1;
- }
- BOOL CreateWindowMenu() {
- WindowMenu = CreateMenu();
- if (!WindowMenu)
- return 0;
- HMENU mainDropdown = CreatePopupMenu();
- AppendMenu(mainDropdown, MF_STRING, CREDITS, "Credits");
- AppendMenu(mainDropdown, MF_STRING, ABOUT, "About");
- AppendMenu(mainDropdown, MF_STRING, COMMANDS, "Commands");
- AppendMenu(WindowMenu, MF_POPUP, (UINT_PTR)mainDropdown, "Layout Source");
- return 1;
- }
- BOOL StartMessageLoop() {
- MSG msg;
- BOOL bRet;
- while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
- {
- if (bRet == 0) {
- return 0;
- }
- else if (bRet == -1)
- {
- // handle the error and possibly exit
- //return msg.wParam;
- return 0;
- }
- else
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
- }
- BOOL InitiateWindow() {
- HInstance = GetModuleHandle(NULL);
- UnregisterClass("WINDOW", HInstance);
- RegisterWindowClass("WINDOW");
- char Name[50];
- _snprintf_s(Name, 50, "Layout Source");
- if (!CreateWindowMenu())
- return 0;
- if (!(MainWindow = CreateWindowEx(NULL, "WINDOW", Name, WS_SYSMENU | WS_MINIMIZEBOX, 100, 100, 560, 500, NULL, WindowMenu, HInstance, NULL))) return 0;
- CreateSubwindows();
- ::SetWindowPos(MainWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE);
- ShowWindow(MainWindow, SW_SHOWNORMAL);
- UpdateWindow(MainWindow);
- main();
- return StartMessageLoop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement