Fixed the RegisterClass call

This commit is contained in:
Elias Naur 2002-12-18 16:40:12 +00:00
parent ad03fe3b3b
commit 040d03dca4
2 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,8 @@
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
HINSTANCE dll_handle;
/* /*
* DLL entry point for Windows. Called when Java loads the .dll * DLL entry point for Windows. Called when Java loads the .dll
*/ */
@ -52,5 +54,6 @@ BOOL WINAPI DllMain(
LPVOID lpvReserved // reserved LPVOID lpvReserved // reserved
) )
{ {
dll_handle = hinstDLL;
return TRUE; // Success return TRUE; // Success
} }

View File

@ -49,6 +49,7 @@
#define WINDOWCLASSNAME "LWJGLWINDOW" #define WINDOWCLASSNAME "LWJGLWINDOW"
extern HINSTANCE dll_handle;
// Initialise static variables // Initialise static variables
bool oneShotInitialised = false; bool oneShotInitialised = false;
HWND hwnd = NULL; // Handle to the window HWND hwnd = NULL; // Handle to the window
@ -210,7 +211,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_nCreate
windowClass.lpfnWndProc = WindowProc; windowClass.lpfnWndProc = WindowProc;
windowClass.cbClsExtra = 0; windowClass.cbClsExtra = 0;
windowClass.cbWndExtra = 0; windowClass.cbWndExtra = 0;
windowClass.hInstance = (HINSTANCE) GetCurrentProcess(); windowClass.hInstance = dll_handle;
windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
windowClass.hCursor = LoadIcon(NULL, IDC_ARROW); windowClass.hCursor = LoadIcon(NULL, IDC_ARROW);
windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);