
[quote author=trin link=board=1;threadid=275;start=0#6560 date=1029283744]das die leute immer so pingelich sind ;D[/quote]
Sorry, bei sowas verstehe ich nunmal keinen Spaß. >:( ;D
Code: Alles auswählen
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
char szAppName[] = "Scummer";
HWND hwnd;
MSG msg;
WNDCLASSEX wndclass;
if(FindWindow("Scummer","Scummer"))
{
SendMessage(hwnd,WM_DESTROY,0,0);
return 0;
}
wndclass.cbSize = sizeof (wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = GetModuleHandle(0) ;
wndclass.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_ICON1));
wndclass.hIconSm = 0;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) GetSysColorBrush(COLOR_BTNFACE);
wndclass.lpszMenuName = 0;
wndclass.lpszClassName = szAppName;
RegisterClassEx (&wndclass);
hwnd = CreateWindow(szAppName, "Scummer", WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, 500, 410,
NULL, NULL, hInstance, NULL);
ShowWindow (hwnd, iCmdShow);
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}
Code: Alles auswählen
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
char szAppName[] = "Scummer";
HWND hwnd;
MSG msg;
WNDCLASSEX wndclass;
if(FindWindow("Scummer","Scummer"))
{
SendMessage(hwnd,WM_DESTROY,0,0);
return 0;
}
wndclass.cbSize = sizeof (wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = GetModuleHandle(0) ;
wndclass.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_ICON1));
wndclass.hIconSm = 0;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) GetSysColorBrush(COLOR_BTNFACE);
wndclass.lpszMenuName = 0;
wndclass.lpszClassName = szAppName;
RegisterClassEx (&wndclass);
hwnd = CreateWindow(szAppName, "Scummer", WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, 500, 410,
NULL, NULL, hInstance, NULL);
ShowWindow (hwnd, iCmdShow);
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}
Code: Alles auswählen
HWND hwnd;
if(FindWindow("Scummer","Scummer"))
{
SendMessage(hwnd,WM_DESTROY,0,0);
return 0;
}
Code: Alles auswählen
if(FindWindow("Scummer","Scummer"))
{
PostQuitMessage(0);
return 0;
}