[Jsmooth-cvs] jsmooth/skeletons/simplewrap main.cpp,1.17,1.18
Status: Beta
Brought to you by:
reyes
From: <re...@us...> - 2004-03-06 13:54:49
|
Update of /cvsroot/jsmooth/jsmooth/skeletons/simplewrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21736/skeletons/simplewrap Modified Files: main.cpp Log Message: removed un-necessary window creation code, causing bug #858829 Index: main.cpp =================================================================== RCS file: /cvsroot/jsmooth/jsmooth/skeletons/simplewrap/main.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** main.cpp 4 Mar 2004 22:13:55 -0000 1.17 --- main.cpp 6 Mar 2004 13:31:52 -0000 1.18 *************** *** 23,28 **** #include "resource.h" - - #include "common.h" #include "ResourceManager.h" --- 23,26 ---- *************** *** 30,43 **** #include "JavaMachineManager.h" - void SaveJarResource(); - - /* Declare Windows procedure */ - LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); - - /* Make the class name into a global variable */ - char szClassName[ ] = "JSmooth"; - ResourceManager* globalResMan; - DebugConsole *DEBUGCONSOLE = NULL; --- 28,32 ---- *************** *** 50,62 **** } - // void debug(std::string text) - // { - // } - - // void _debugOutputCheck(std::string text) - // { - // debug(text); - // } - void _debugOutput(const std::string& text) { --- 39,42 ---- *************** *** 79,125 **** MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ ! ! // jlist->run(); ! atexit(lastExit); - // debugOutput = debug; - - /* The Window structure */ - wincl.hInstance = hThisInstance; - wincl.lpszClassName = szClassName; - wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */ - wincl.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; /* Catch double-clicks */ - wincl.cbSize = sizeof (WNDCLASSEX); - - /* Use default icon and mouse-pointer */ - wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); - wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION); - wincl.hCursor = LoadCursor (NULL, IDC_ARROW); - wincl.lpszMenuName = NULL; /* No menu */ - wincl.cbClsExtra = 0; /* No extra bytes after the window class */ - wincl.cbWndExtra = 0; /* structure or the window instance */ - /* Use Windows's default color as the background of the window */ - wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND; - - /* Register the window class, and if it fails quit the program */ - if (!RegisterClassEx (&wincl)) - return 0; - - /* The class is registered, let's create the program*/ - - hwnd = CreateWindowEx ( - 0, /* Extended possibilites for variation */ - szClassName, /* Classname */ - "Windows App", /* Title Text */ - WS_OVERLAPPEDWINDOW, /* default window */ - CW_USEDEFAULT, /* Windows decides the position */ - CW_USEDEFAULT, /* where the window ends up on the screen */ - 544, /* The programs width */ - 375, /* 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 */ - ); globalResMan = new ResourceManager("JAVA", PROPID, JARID); --- 59,64 ---- MSG messages; /* Here messages to the application are saved */ WNDCLASSEX wincl; /* Data structure for the windowclass */ ! atexit(lastExit); globalResMan = new ResourceManager("JAVA", PROPID, JARID); *************** *** 148,154 **** SetCurrentDirectory(newcurdir.c_str()); - ShowWindow(hwnd, SW_HIDE); - UpdateWindow(hwnd); - JavaMachineManager man(*globalResMan); std::string preferDLLstr = globalResMan->getProperty("skel_SingleProcess"); --- 87,90 ---- *************** *** 167,226 **** } - // MessageBox(hwnd, "Launched java", "DEBUG", MB_OKCANCEL|MB_ICONQUESTION|MB_APPLMODAL); - DEBUG("NORMAL EXIT"); DEBUGWAITKEY(); - /* Make the window visible on the screen */ - - // ShowWindow (hwnd, nFunsterStil); - // UpdateWindow(hwnd); - /* Run the message loop. It will run until GetMessage() returns 0 */ - // while (GetMessage (&messages, NULL, 0, 0) > 0) - // { - // /* Translate virtual-key messages into character messages */ - // TranslateMessage(&messages); - // /* Send message to WindowProcedure */ - // DispatchMessage(&messages); - // } - - // MessageBox(hwnd, "AFTER GETMESSAGE", "DEBUG", MB_OKCANCEL|MB_ICONQUESTION|MB_APPLMODAL); - - delete DEBUGCONSOLE; - /* The program return-value is 0 - The value that PostQuitMessage() gave */ return messages.wParam; } - - /* This function is called by the Windows function DispatchMessage() */ - - LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) - { - HDC hdc; - PAINTSTRUCT ps; - - char buffer[255]; - char * mesg = "............................"; - mesg = buffer; - - switch (message) /* handle the messages */ - { - case WM_PAINT: - hdc = BeginPaint(hwnd, &ps); - // TODO: Add any drawing code here... - RECT rt; - GetClientRect(hwnd, &rt); - DrawText(hdc, mesg, 10, &rt, DT_CENTER); - EndPaint(hwnd, &ps); - break; - - case WM_DESTROY: - PostQuitMessage (0); /* send a WM_QUIT to the message queue */ - break; - default: /* for messages that we don't deal with */ - return DefWindowProc (hwnd, message, wParam, lParam); - } - - return 0; - } --- 103,111 ---- |