Jeg får stadig fejl:
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
HINSTANCE InstanceHandle;
HWND MainWindow;
STARTUPINFO si =
{
sizeof(STARTUPINFO),
NULL,
NULL,
"Title",
0, 0, 0, 0,
0, 0,
0,
0,
0,
0,
0,
0,
0,
0
};
PROCESS_INFORMATION pi;
enum numbers {
button1 = 1000,
button2,
button3
};
void DoPaint(HDC dc)
{
HFONT Font = CreateFont(32, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, "Comic Sans MS");
SetTextColor(dc, RGB(255, 0, 0));
SetBkMode(dc, TRANSPARENT);
HGDIOBJ OldFont = SelectObject(dc, Font);
TextOut(dc, 150, 15, "Counter-Strike 1.6", 18);
SelectObject(dc, OldFont);
DeleteObject(Font);
}
LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_CREATE:
CreateWindow("BUTTON",
"Installer Cs 1.6",
WS_CHILD | WS_VISIBLE | WS_TABSTOP,
50, 85, 110, 30,
hwnd,
(HMENU) (button1),
InstanceHandle,
0);
CreateWindow("BUTTON",
"Installer Bots",
WS_CHILD | WS_VISIBLE | WS_TABSTOP,
50, 130, 110, 30,
hwnd,
(HMENU) (button2),
InstanceHandle,
0);
CreateWindow("BUTTON",
"Læs dette!",
WS_CHILD | WS_VISIBLE | WS_TABSTOP,
50, 175, 110, 30,
hwnd,
(HMENU) (button3),
InstanceHandle,
0);
break;
case WM_COMMAND:
if(HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == button1) {
CreateProcess(NULL, "cs16.exe",
NULL,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&pi,
&si);
}
if(HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == button2) {
}
if(HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == button3) {
system("Readme.txt exit");
}
break;
case WM_PAINT:
HDC dc;
PAINTSTRUCT PaintStruct;
dc = BeginPaint(hwnd, &PaintStruct);
DoPaint(dc);
EndPaint(hwnd, &PaintStruct);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,msg,wParam,lParam);
}
return 0;
}
HWND CreateMainWindow()
{
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS ;
wc.lpfnWndProc = (WNDPROC )MainWndProc;
wc.hInstance = InstanceHandle;
wc.hbrBackground = (HBRUSH )(COLOR_BTNFACE + 1);
wc.lpszClassName = "SimpleWinWndClass";
wc.lpszMenuName = 0;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClass(&wc))
return 0;
return CreateWindow("SimpleWinWndClass",
"Counter-Strike 1.6",
WS_MINIMIZEBOX | WS_VISIBLE |
WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_THICKFRAME,
CW_USEDEFAULT, 0, 500, 300,
0,
0,
InstanceHandle,
0);
}
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
INT nCmdShow)
{
InstanceHandle = hInstance;
if((MainWindow = CreateMainWindow()) == (HWND )0)
{
MessageBox(0, "Failed to create MainWindow!", "Warning", MB_OK);
return 0;
}
ShowWindow(MainWindow, SW_SHOW);
MSG Msg;
while(GetMessage(&Msg, 0, 0, 0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
setup.cpp:
Error E2227 setup.cpp 98: Extra parameter in call to __stdcall CreateProcessA(co
nst char *,char *,_SECURITY_ATTRIBUTES *,_SECURITY_ATTRIBUTES *,int,unsigned lon
g,void *,const char *,_STARTUPINFOA *,_PROCESS_INFORMATION *) in function __stdc
all MainWndProc(HWND__ *,unsigned int,unsigned int,long)
*** 1 errors in Compile ***