Anthrax Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.


-=ATX=- is a community that specializes in graphics, machinima, and programming.
 
HomePortalLatest imagesSearchRegisterLog in

 

 Skeleton for a Windows app(C++ too)

Go down 
2 posters
AuthorMessage
RougeAttacker
Co-Leader
RougeAttacker


Number of posts : 37
Registration date : 2008-12-13

Skeleton for a Windows app(C++ too) Empty
PostSubject: Skeleton for a Windows app(C++ too)   Skeleton for a Windows app(C++ too) I_icon_minitimeThu Dec 18, 2008 12:50 am

#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
MessageBox (NULL, "Hello World" , "Tutorial", 0);
return 0;
}




#include <windows.h>

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

static char sClassName[] = "MyClass";
static HINSTANCE zhInstance = NULL;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
WNDCLASSEX WndClass;
HWND hwnd;
MSG Msg;

zhInstance = hInstance;

WndClass.cbSize = sizeof(WNDCLASSEX);
WndClass.style = NULL;
WndClass.lpfnWndProc = WndProc;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hInstance = zhInstance;
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+2);
WndClass.lpszMenuName = NULL;
WndClass.lpszClassName = sClassName;
WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

if(!RegisterClassEx(&WndClass)) {
MessageBox(0, "Error Registering Class!", "Error!", MB_ICONSTOP | MB_OK);
return 0;
}

hwnd = CreateWindowEx(WS_EX_STATICEDGE, sClassName, "Rouge Hacks Injection", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,

CW_USEDEFAULT,
200, 200, NULL, NULL, zhInstance, NULL);

if(hwnd == NULL) {
MessageBox(0, "Error Creating Window!", "Error!", MB_ICONSTOP | MB_OK);
return 0;
}

ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);

while(GetMessage(&Msg, NULL, 0, 0)) {
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}

return Msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
switch(Message) {
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, Message, wParam, lParam);
}

return 0;
}
Back to top Go down
Viva La Saint!
Community Admin



Number of posts : 24
xFire: : saint2019
Registration date : 2008-12-23

Skeleton for a Windows app(C++ too) Empty
PostSubject: Re: Skeleton for a Windows app(C++ too)   Skeleton for a Windows app(C++ too) I_icon_minitimeTue Dec 23, 2008 7:42 pm

Hm, I'll give this a try Very Happy
Sounds neat.
Back to top Go down
RougeAttacker
Co-Leader
RougeAttacker


Number of posts : 37
Registration date : 2008-12-13

Skeleton for a Windows app(C++ too) Empty
PostSubject: Re: Skeleton for a Windows app(C++ too)   Skeleton for a Windows app(C++ too) I_icon_minitimeTue Dec 23, 2008 8:39 pm

Ahh, forgot to post this... this is for a message box, u just need the header for windows. "#include <windows.h>"

Code:


MessageBox(NULL, "This is where you type the message", "Title of box", MB_OK);
Back to top Go down
Sponsored content





Skeleton for a Windows app(C++ too) Empty
PostSubject: Re: Skeleton for a Windows app(C++ too)   Skeleton for a Windows app(C++ too) I_icon_minitime

Back to top Go down
 
Skeleton for a Windows app(C++ too)
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Anthrax Community :: Programming Help :: Visual C++-
Jump to: