Features
- It can handle AA, OTA, SWTA, XTA and EvOTA.
Can launch spring client or spring.exe.
Nice looking.
Convenient.
Made by me.
Moderator: Moderators
Code: Select all
#include <windows.h>
#include "resource.h"
const char g_szClassName[] = "myWindowClass";
extern bool allOff(void);
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
HMENU hMenu, hSubMenu;
HICON hIcon, hIconSm;
hMenu = CreateMenu();
hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, ID_FILE_RUN_CLIENT, "Run Spring &client");
AppendMenu(hSubMenu, MF_STRING, ID_FILE_RUN_SPRING, "Run &Spring.exe");
AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");
hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_AA, "Switch to &AA");
AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_EVOTA, "Switch to &EvOTA");
AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_OTA, "Switch to &OTA");
AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_SWTA, "Switch to &SWTA");
AppendMenu(hSubMenu, MF_STRING, ID_SWITCH_XTA, "Switch to &XTA");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&Switch");
hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, IDD_ABOUT, "&About");
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&Help");
SetMenu(hwnd, hMenu);
}
break;
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case ID_SWITCH_AA:
{
allOff();
system("aa.bat");
}
break;
case ID_SWITCH_EVOTA:
{
allOff();
system("evota.bat");
}
break;
case ID_SWITCH_OTA:
{
allOff();
system("ota.bat");
}
break;
case ID_SWITCH_SWTA:
{
allOff();
system("swta.bat");
}
break;
case ID_SWITCH_XTA:
{
allOff();
system("xta.bat");
}
break;
case ID_FILE_RUN_CLIENT:
{
DestroyWindow(hwnd);
system("SpringClient.exe");
}
break;
case ID_FILE_RUN_SPRING:
{
DestroyWindow(hwnd);
system("spring.exe");
}
break;
case ID_FILE_EXIT:
{
PostMessage(hwnd, WM_CLOSE, 0, 0);
}
break;
case IDD_ABOUT:
{
MessageBox(hwnd, "Made by Das Bruce, uber_napalm_cobra@hotmail.com.", "About", MB_OK);
}
break;
}
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
//Step 1: Registering the Window Class
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MYMENU);
wc.lpszClassName = g_szClassName;
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
// Step 2: Creating the Window
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"Switcher.",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 360, 240,
NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
// Step 3: The Message Loop
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
Code: Select all
#include <windows.h>
bool allOff(void)
{
system("@echo off");
system("if exist AbsoluteAnnihilation.hpi rename AbsoluteAnnihilation.hpi AbsoluteAnnihilation.old");
system("if exist AbsoluteAnnihilation.ccx rename AbsoluteAnnihilation.ccx AbsoluteAnnihilation.old");
system("if exist taenheter.hpi rename taenheter.hpi taenheter.old");
system("if exist taenheter.ccx rename taenheter.ccx taenheter.old");
system("if exist \"SWTA_&_IA_for_Spring_503.gp3\" rename \"SWTA_&_IA_for_Spring_503.gp3\" \"SWTA_&_IA_for_Spring_503.old\"");
system("if exist \"SWTA_&_IA_sounds.ufo\" rename \"SWTA_&_IA_sounds.ufo\" \"SWTA_&_IA_sounds.old\"");
system("if exist OTA_settings_for_spring_patch.ufo rename OTA_settings_for_spring_patch.ufo OTA_settings_for_spring_patch.old");
return true;
}
Code: Select all
#define IDR_MYMENU 101
#define IDI_MYICON 201
#define ID_SWITCH_AA 9001
#define ID_SWITCH_EVOTA 9002
#define ID_SWITCH_XTA 9003
#define ID_SWITCH_SWTA 9004
#define ID_SWITCH_OTA 9005
#define ID_FILE_EXIT 9011
#define ID_FILE_RUN_CLIENT 9013
#define ID_FILE_RUN_SPRING 9014
#define IDD_ABOUT 9021
I had cool points!?! SWEET! I thought I had none.Buggi wrote:smoth... dude, you just lost cool points.
Which is a bad thing, cool points must be collected and cherished.
-Buggi
Code: Select all
@echo off
echo continue if you are sure you want to install this mod into your modman.
echo next batch file installs EvOTA2 mod.
echo WARNING: modman doesn't warn if you have same mod installed already.
pause
AddMod "EvOTA2" /P "taenheter.old" "taenheter.ccx" /P "OTA_settings_for_spring_patch.ufo.old" "OTA_settings_for_spring_patch.ufo" /P "Objects3Dold" "Objects3D"
pause
It is mainly the IDE, but I ran into issues with C# trying to use old C++ so for the past semester I used Vb.net. I figured it would be fun to learn another language.Liam wrote:... plenty of IDEs have that kind of functionality built in smoth, i wouldn't say the language was handy, maybe the IDE is (to be honest, haven't used it so i can't say either way)