Welcome to the Club Penguin Wiki! Log in or Create an account to join the community!

User:Nando144

From the Club Penguin Wiki, the free, editable encyclopedia about Club Penguin
Revision as of 11:53, 29 October 2011 by 174.129.207.64 (talk) (C++)
Jump to navigation Jump to search
  1. include <windows.h>
const char g_szClassName[] = "lulz";

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

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

   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=NULL%3B
   wc.lpszClassname=g_szClassName%3B
   wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
   
   hwnd = CreateWindowEx(
      WS_EX_CLIENTEDGE,
      g_szClassName,
      "Worthless Piece of shit.",
      WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
      NULL, NULL, hInstance, NULL);

   ShowWindow(hwnd, nCmdShow);
   UpdateWindow(hwnd);
   
   while(GetMessage(&Msg, NULL, 0, 0) > 0)
   {
      TranslateMessage(&Msg);
      DispatchMessage(&Msg);
   }
   return Msg.wParam;
}