Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the same again PLEASE just a window in Windows!

Status
Not open for further replies.

tunahead

Programmer
Feb 22, 2003
9
AT
"I seem to have 3 errors in this and they are all from here" hWnd CreateMainWindow(HINSTANCE hInstance) "to here. It says that there is missing a ; before the identifier CreateWindowMain. Here is the rest of the code (its only a simple Windows in Windows)
{
WNDCLASSEX wndClass; //WNDCLASSEX Struktur

//Struktur initialisieren
wndClass.cbSize=sizeof(WNDCLASSEX); //Größe angeben
wndClass.style =CS_DBLCLKS | CS_OWNDC|//Standart
CS_HREDRAW | CS_VREDRAW;//Stile

//Callbackfunktion angeben (noch nicht durchgenommen)
wndClass.lpfnWndProc=MessageHandler;

wndClass.cbClsExtra=0; //Zusätzliche Angaben

wndClass.cbWndExtra=0; //Werden nicht benötigt

wndClass.hInstance=hInstance; //Anwendungsinstanz

//Weisser Pinsel zum füllen des fensterhintergrunds
wndClass.hbrBackground=
(HBRUSH)GetStockObject(WHITE_BRUSH);

//Standart-Mauscursor verwenden
wndClass.hCursor=LoadCursor(NULL, IDC_ARROW);

//Das Fenster soll kein Menü haben
wndClass.lpszMenuName=NULL;

//Der Name der Fensterklasse wird noch beim Aufruf
//vonCreateWindowEx benötigt
wndClass.lpszClassName="WindowClass";

//Icons für das Fenster festlegen:
wndClass.hIcon=LoadIcon(NULL, IDI_WINLOGO);
wndClass.hIconSm=LoadIcon(NULL, IDI_WINLOGO);

//Fensterklasse registrieren, damit sie von
//CreateWindowEx verwendet werden kann
RegisterClassEx(&wndClass);

//Der Rückgabewert von CreateWindowEx is auch der
//Rückgabewert von der
//Funktion:
return CreateWindowEx(
NULL, //Ohne erweiterte Stile
"WindowClass", //Klassenname
"Ein einfaches Fenter", //Fenstertitel
WS_OVERLAPPEDWINDOW, //Fenstereingenschaften
WS_VISIBLE,

0, 0, //Anfangsposition
400, 300, //Größe
NULL, //Handle des Elterfensters
NULL, //Handle des Menüs
hInstance, //Anwendungsinstanz
NULL, //Nicht benötigt
);


}


than you
goomouse
 
//this is one of the shortest "hello world" in windows

#include<conio.h>
#include<windows.h>
int main()
{
HWND hWnd = CreateWindow
(
&quot;button&quot;, &quot;hello world&quot;, WS_OVERLAPPEDWINDOW | BS_PUSSHBUTTON | WS_VISIBLE, 10, 10, 500, 500, NULL, (HMENU)0,
GetModuleHandle(0), 0);
);
getch();
return 0;
} Ion Filipski
1c.bmp


filipski@excite.com
 
In the line that had an error, you wrote:

[tt]hWnd CreateMainWindow(HINSTANCE hinstance)[/tt]

What that means is that you are declaring a function which returns a value of type [tt]hWnd[/tt].

I think what you meant was [tt]HWND[/tt]. Remember, identifiers in C are case-sensitive!

Also, Notice that most Win32 types (such as [tt]DWORD[/tt], [tt]HWND[/tt], [tt]CREATESTRUCT[/tt]) are in all caps.

Hope this helps, and sorry I couldn't understand the Deutsch comments :D
Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top