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

Last change on this file since 6241 was 6241, checked in by sandervl, 24 years ago

some icon fixes

File size: 4.7 KB
Line 
1/* $Id: win32wdesktop.cpp,v 1.18 2001-07-08 07:15:09 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
19#define DBG_LOCALLOG DBG_win32wdesktop
20#include "dbglocal.h"
21
22Win32Desktop *windowDesktop = 0;
23
24//******************************************************************************
25//******************************************************************************
26BOOL CreateWin32Desktop()
27{
28 windowDesktop = new Win32Desktop();
29 if(windowDesktop == NULL) {
30 dprintf(("Unable to create desktop window!!!"));
31 return FALSE;
32 }
33 return TRUE;
34}
35//******************************************************************************
36//******************************************************************************
37void DestroyDesktopWindow()
38{
39 if(windowDesktop) {
40 delete windowDesktop;
41 windowDesktop = 0;
42 }
43}
44//******************************************************************************
45//******************************************************************************
46Win32Desktop::Win32Desktop() : Win32BaseWindow()
47{
48 rectWindow.left = 0;
49 rectWindow.top = 0;
50 rectWindow.right = OSLibQueryScreenWidth();
51 rectWindow.bottom = OSLibQueryScreenHeight();
52
53 OS2Hwnd = OSLIB_HWND_DESKTOP;
54 OS2HwndFrame = OSLIB_HWND_DESKTOP;
55 rectClient = rectWindow;
56
57 if(HwAllocateWindowHandle(&Win32Hwnd, (ULONG)this) == FALSE)
58 {
59 dprintf(("Win32BaseWindow::Init HwAllocateWindowHandle failed!!"));
60 DebugInt3();
61 }
62 dprintf(("Desktop window %x", Win32Hwnd));
63
64 /* Find the window class */
65 windowClass = Win32WndClass::FindClass(0, (LPSTR)DESKTOP_CLASS_ATOM);
66
67 setWindowProc(windowClass->getWindowProc());
68
69 dwStyle |= WS_VISIBLE;
70}
71//******************************************************************************
72//******************************************************************************
73Win32Desktop::~Win32Desktop()
74{
75}
76//******************************************************************************
77//******************************************************************************
78BOOL Win32Desktop::isDesktopWindow()
79{
80 return TRUE;
81}
82//******************************************************************************
83//Disabling the desktop is not a good idea (mouse no longer responds)
84//******************************************************************************
85BOOL Win32Desktop::EnableWindow(BOOL fEnable)
86{
87 return TRUE; //of course we succeeded
88}
89//******************************************************************************
90//******************************************************************************
91BOOL Win32Desktop::DestroyWindow()
92{
93 dprintf(("WARNING: can't destroy desktop window!!"));
94 return FALSE;
95}
96//******************************************************************************
97//Dummy window procedure. Does nothing.
98//******************************************************************************
99LRESULT WIN32API DesktopWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
100{
101 switch (message)
102 {
103 case WM_GETTEXT:
104 if (!lParam || !wParam) return 0;
105 ((LPSTR)lParam)[0] = 0;
106 return 0;
107 }
108
109 return 0;
110}
111//******************************************************************************
112//******************************************************************************
113BOOL WIN32API SetDeskWallPaper(LPCSTR filename)
114{
115 dprintf(("USER32: SetDeskWallPaper - empty stub!"));
116
117 return TRUE;
118}
119//******************************************************************************
120//******************************************************************************
121BOOL DESKTOP_Register()
122{
123 WNDCLASSA wndClass;
124
125 ZeroMemory(&wndClass,sizeof(WNDCLASSA));
126 wndClass.style = CS_GLOBALCLASS;
127 wndClass.lpfnWndProc = (WNDPROC)DesktopWndProc;
128 wndClass.cbClsExtra = 0;
129 wndClass.cbWndExtra = 0;
130 wndClass.hCursor = LoadCursorA(0, IDC_ARROWA);
131 wndClass.hbrBackground = 0;
132 wndClass.lpszClassName = DESKTOP_CLASS_NAMEA;
133
134 return RegisterClassA(&wndClass);
135}
136//******************************************************************************
137//******************************************************************************
138BOOL DESKTOP_Unregister()
139{
140 if (GlobalFindAtomA(DESKTOP_CLASS_NAMEA))
141 return UnregisterClassA(DESKTOP_CLASS_NAMEA,(HINSTANCE)NULL);
142 else return FALSE;
143}
144//******************************************************************************
145//******************************************************************************
Note: See TracBrowser for help on using the repository browser.