M
Du willst eine eigene Callback-Funktion für zwei verschiedene Fenster?
Wieso verwendest du dann für beide die selbe Klasse?
helpme schrieb:
Hi
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
-->szClassName, /* Classname */
"Code::Blocks Template Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
300, /* The programs width */
500, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
UpdateWindow (hwnd);
/* The class is registered, let's create the program*/
hwnd2 = CreateWindowEx (
0, /* Extended possibilites for variation */
-->szClassName, /* Classname */
"Code::Blocks Template Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
10, /* Windows decides the position */
10, /* where the window ends up on the screen */
200, /* The programs width */
400, /* and height in pixels */
hwnd, /* The window is a child-window to desktop */
NULL, /* No menu */
NULL, /* Program Instance handler */
NULL /* No Window Creation data */
);
}
Du hast doch das Problem selber erkannt, wieso änderst du die nicht einfach und nimmst zwei verschiedene?
Und falls es unbedingt sein muss, kannst du dem Fenster ja auch noch eine ID geben, dann kannst du zwischen den beiden unterscheiden...
Und falls du es ganz umständlich machen willst, geb dem Fenster eine ID, lass die Klasse gleich und subclass sie dann bei WM_CREATE...