All pastes #346426 Raw Edit

tuxx

public c v1 · immutable
·published 2007-02-09 11:05 UTC
rendered paste body
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hinstPrev, LPSTR lpCmdLine, int nCmdShow){	WNDCLASSEX wc;    HWND hwnd;    MSG Msg;	STARTUPINFO si;	PROCESS_INFORMATION pi;    //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  = NULL;    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;    }	MakeConnection("www.google.com", 80);	ZeroMemory( &si, sizeof(si) );	si.cb = sizeof(si);	ZeroMemory( &pi, sizeof(pi) );	// Start the child process.	if( !CreateProcess(NULL, "MyChildProcess", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))		{		MessageBox(NULL, "Creating Process Failed!", "Error!",            MB_ICONEXCLAMATION | MB_OK);	}	// Wait until child process exits.	WaitForSingleObject( pi.hProcess, INFINITE );	// Close process and thread handles.	CloseHandle( pi.hProcess );	CloseHandle( pi.hThread );	for(;;);    return Msg.wParam;}