Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <fstream>
- using namespace std;
- LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpCmdLine, int nCmdShow)
- {
- MSG msg;
- WNDCLASS wc = { 0 };
- wc.lpszClassName = TEXT("Buttons");
- wc.hInstance = hInstance;
- wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
- wc.lpfnWndProc = WndProc;
- wc.hCursor = LoadCursor(0, IDC_ARROW);
- RegisterClass(&wc);
- CreateWindow(wc.lpszClassName, TEXT("AutoBuddyBuildMaker GUI by n0thing17"),
- WS_SYSMENU | WS_VISIBLE | WS_MINIMIZEBOX,
- 0, 0, 1766, 780, 0, 0, hInstance, 0);
- while (GetMessage(&msg, NULL, 0, 0)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- return (int)msg.wParam;
- }
- LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- ofstream myfile;
- myfile.open("ChampionName-SummonersRift.txt", fstream::app);
- switch (msg)
- {
- case WM_CREATE:
- {
- CreateWindow(TEXT("button"), TEXT("Abyssal Scepter"),
- WS_VISIBLE | WS_CHILD,
- 10, 40*0+5, 175, 40,
- hwnd, (HMENU)1, NULL, NULL);
- CreateWindow(TEXT("button"), TEXT("Aegis of the Legion"),
- WS_VISIBLE | WS_CHILD,
- 175*1+9, 40*0+5, 175, 40,
- hwnd, (HMENU)2, NULL, NULL);
- CreateWindow(TEXT("button"), TEXT("AutoBuddyBuildMakerGui made by n0thing17"),
- WS_VISIBLE | WS_CHILD,
- 175*6+4, 40*17-12, 523, 79,
- hwnd, (HMENU)177, NULL, NULL);
- CreateWindow(TEXT("button"), TEXT("QUIT"),
- WS_VISIBLE | WS_CHILD,
- 175*9+1, 40*17-12, 175, 79,
- hwnd, (HMENU)178, NULL, NULL);
- CreateWindow(TEXT("button"), TEXT("Beep"),
- WS_VISIBLE | WS_CHILD,
- 175*4+6, 40*18-13, 175, 40,
- hwnd, (HMENU)183, NULL, NULL);
- CreateWindow(TEXT("button"), TEXT("Show File Content"),
- WS_VISIBLE | WS_CHILD,
- 175*5+5, 40*18-13, 174, 40,
- hwnd, (HMENU)184, NULL, NULL);
- break;
- }
- case WM_COMMAND:
- {
- if (LOWORD(wParam) == 1) {
- myfile << "3001:Buy,";
- }
- if (LOWORD(wParam) == 2) {
- myfile << "3105:Buy,";
- }
- if (LOWORD(wParam) == 177) {
- MessageBox(hwnd, " This program is made by n0thing17. A simple \"Multumesc\"(Thank you) will make him happy", " Once Exiled, Forever Exiled", MB_OK | MB_ICONINFORMATION);
- }
- if (LOWORD(wParam) == 178) {
- ifstream fileIn( "ChampionName-SummonersRift.txt");
- string contents;
- fileIn >> contents;
- fileIn.close();
- contents.pop_back();
- ofstream fileOut( "ChampionName-SummonersRift.txt", ios::trunc );
- fileOut << contents;
- fileOut.close();
- PostQuitMessage(0);
- break;
- }
- if (LOWORD(wParam) == 183) {
- Beep(432, 500);
- }
- if (LOWORD(wParam) == 184) {
- string getcontent;
- const char * c = getcontent.c_str();
- ifstream openfile ("ChampionName-SummonersRift.txt");
- if(openfile.is_open())
- {
- while(! openfile.eof())
- {
- openfile >> getcontent;
- MessageBox(hwnd, getcontent.c_str(), "NONE", MB_OK | MB_ICONINFORMATION);
- }
- }
- }
- break;
- }
- case WM_DESTROY:
- {
- ifstream fileIn( "ChampionName-SummonersRift.txt");
- string contents;
- fileIn >> contents;
- fileIn.close();
- contents.pop_back();
- ofstream fileOut( "ChampionName-SummonersRift.txt", ios::trunc );
- fileOut << contents;
- fileOut.close();
- PostQuitMessage(0);
- break;
- }
- }
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement