source: trunk/src/user32/win32wdesktop.cpp@ 1036

Last change on this file since 1036 was 1014, checked in by sandervl, 26 years ago

Added desktop window class. Instance created when user32 is loaded

File size: 3.1 KB
Line 
1/* $Id: win32wdesktop.cpp,v 1.1 1999-09-23 10:33:59 sandervl Exp $ */
2/*
3 * Win32 Desktop Window for OS/2
4 *
5 *
6 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 */
12#include <os2win.h>
13#include <misc.h>
14#include <win32wbase.h>
15#include <win32wdesktop.h>
16#include "oslibwin.h"
17#include "win32wndhandle.h"
18
19Win32Desktop *windowDesktop = 0;
20
21//******************************************************************************
22//******************************************************************************
23BOOL CreateWin32Desktop()
24{
25 windowDesktop = new Win32Desktop();
26 if(windowDesktop == NULL) {
27 dprintf(("Unable to create desktop window!!!"));
28 return FALSE;
29 }
30 return TRUE;
31}
32//******************************************************************************
33//******************************************************************************
34void DestroyDesktopWindow()
35{
36 if(windowDesktop) {
37 delete windowDesktop;
38 windowDesktop = 0;
39 }
40}
41//******************************************************************************
42//******************************************************************************
43Win32Desktop::Win32Desktop() : Win32BaseWindow(OBJTYPE_WINDOW)
44{
45 OSLibWinQueryWindowRect(OSLIB_HWND_DESKTOP, &rectWindow, RELATIVE_TO_SCREEN);
46 OS2Hwnd = OSLIB_HWND_DESKTOP;
47 OS2HwndFrame = OSLIB_HWND_DESKTOP;
48 rectClient = rectWindow;
49
50 /* Find the window class */
51 windowClass = Win32WndClass::FindClass(-1, (LPSTR)DESKTOP_CLASS_ATOM);
52}
53//******************************************************************************
54//******************************************************************************
55Win32Desktop::~Win32Desktop()
56{
57}
58//******************************************************************************
59//Dummy window procedure. Does nothing.
60//******************************************************************************
61LRESULT WIN32API DesktopWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
62{
63 return 0;
64}
65//******************************************************************************
66//******************************************************************************
67BOOL DESKTOP_Register()
68{
69 WNDCLASSA wndClass;
70
71 ZeroMemory(&wndClass,sizeof(WNDCLASSA));
72 wndClass.style = CS_GLOBALCLASS;
73 wndClass.lpfnWndProc = (WNDPROC)DesktopWndProc;
74 wndClass.cbClsExtra = 0;
75 wndClass.cbWndExtra = 0;
76 wndClass.hCursor = (HCURSOR)IDC_ARROWA;
77 wndClass.hbrBackground = 0;
78 wndClass.lpszClassName = DESKTOP_CLASS_NAMEA;
79
80 return RegisterClassA(&wndClass);
81}
82//******************************************************************************
83//******************************************************************************
84BOOL DESKTOP_Unregister()
85{
86 if (GlobalFindAtomA(DESKTOP_CLASS_NAMEA))
87 return UnregisterClassA(DESKTOP_CLASS_NAMEA,(HINSTANCE)NULL);
88 else return FALSE;
89}
90//******************************************************************************
91//******************************************************************************
Note: See TracBrowser for help on using the repository browser.