Post by smc44 on Dec 13, 2008 12:33:32 GMT -5
im sure no one cares but ive been doing some stuff on my own and its been working so here goes something that shows some of the stuff i learned in C++, im sure no one cares, its not much, its just meant to show a few things i learned thanks
#include<iostream.h>
#include<windows.h>
//Special Numbers
#define PI 3.14
int main(void)
{
struct MessageBoxY;
{
char *MessageInBox = "Test Message!";
char *MessageInCaption = "Message Box Text!";
MessageBox(NULL, MessageInBox, MessageInCaption, MB_OK | MB_ICONERROR);
}
char *Message = "Press Ok!";
int LoopAmount = 0;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow);
cout << "Test!" << endl;
int MessageBoxX = MessageBox(NULL, Message, "Cool!", MB_OK | MB_ICONEXCLAMATION);
MessageBoxX;
do {
cout << "You Pressed ok" << endl;
cout << "Press any key 3 more times!" << endl;
LoopAmount++;
system("PAUSE");
} while(LoopAmount<3);
do {
LoopAmount++;
MessageBox(NULL, "Press ok 2 more times!", "Box!", MB_OK | MB_ICONHAND);
} while(LoopAmount<5);
struct RNG; //Random Number Generation
{
do {
int MessageR = MessageBox(NULL, "Random Number Generation!", "Cool!", MB_OK | MB_ICONEXCLAMATION);
int FirstRand = RAND_MAX;
int SecondRand = RAND_MAX;
LoopAmount++;
cout << FirstRand + RAND_MAX * PI + rand() << endl;
MessageR;
cout << SecondRand + RAND_MAX * PI + rand() << endl;
system("Color 1C");
if (MB_OK | MB_ICONEXCLAMATION)
{
cout << "Random Numbers!" << endl;
}
} while(LoopAmount<10);
}
cout << "Name of new Wallpaper?";
struct ChangeDesktop;
{
HKEY hKey;
unsigned char NewDesktop[24] = "";
std::cin >> NewDesktop;
RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop", 0, KEY_SET_VALUE,&hKey);
RegSetValueEx(hKey, "Wallpaper", 0, REG_SZ, NewDesktop, sizeof(NewDesktop));
RegCloseKey(hKey);
}
cout << "*****End Of Program!******" << endl;
}