Hi Gernot,
bin am verzweifeln, bekomms einfach nicht hin in GLB...
Könntest du bitte Hilfestellung geben?
Oh mann - ich hab so wenig Zeit....
LRESULT CALLBACK WndProc(
HWND hWnd,
UINT msg,
WPARAM wParam,
LPARAM lParam ) {
switch(msg)
{
default:
return DefWindowProc( hWnd, msg, wParam, lParam);
}
return 0;
}
void MachFenter() {
WNDCLASSEX wce;
wce.cbSize = sizeof(wce);
wce.style = CS_VREDRAW | CS_HREDRAW;
wce.lpfnWndProc = (WNDPROC) WndProc;
wce.cbClsExtra = 0;
wce.cbWndExtra = 0;
wce.hInstance = hInstance;
wce.hIcon = LoadIcon((HINSTANCE) NULL, IDI_APPLICATION);
wce.hCursor = LoadCursor((HINSTANCE) NULL, IDC_ARROW);
wce.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wce.lpszMenuName = 0;
wce.lpszClassName = "WinClass",
wce.hIconSm = 0;
if (!RegisterClassEx(&wce)) return 0;
HWND hWnd = CreateWindowEx(
0, // Ex Styles
"WinClass",
"Test",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, // x
CW_USEDEFAULT, // y
CW_USEDEFAULT, // Height
CW_USEDEFAULT, // Width
NULL, // Parent Window
NULL, // Menu, or windows id if child
hInstance, //
NULL // Pointer to window specific data
);
ShowWindow( hWnd, nCmdShow );
}
int CheckWindow()
{
MSG msg;
int r;
while ((r = GetMessage(&msg, NULL, 0, 0 )) != 0) {
if (r == -1) {
; // Error!
}
else {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
// The application's return value
return msg.wParam;
};
Die CheckMessage in einem Thread aufrufen - oder mit PeekMessage arbeiten.
problem an der ganzen sache ist das wir leider keine funktionen wie GetMessage und co haben. Die sind in der Windows.h definiert und die können wir bekanntermaßen ja nicht einfügen.
Doch user32.dll
Nur gibts noch das hInstance & Co problem!
Musst Du hast Copy/Paste aus dem windows.h nehmen. Die funktionen linken dann schon.
Danke Gernot.
@ Schranzi: Nun einigen wir uns doch bitte auf eine Lösung... Entweder non DLL oder nur DLL ;)