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

Last change on this file since 2739 was 2739, checked in by cbratschi, 26 years ago

menu and titlebar fix, some new stubs

File size: 4.1 KB
Line 
1/* $Id: win32wdesktop.cpp,v 1.11 2000-02-10 18:49:53 cbratschi 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 if(HwAllocateWindowHandle(&Win32Hwnd, (ULONG)this) == FALSE)
51 {
52 dprintf(("Win32BaseWindow::Init HwAllocateWindowHandle failed!!"));
53 DebugInt3();
54 }
55 dprintf(("Desktop window %x", Win32Hwnd));
56
57 /* Find the window class */
58 windowClass = Win32WndClass::FindClass(0, (LPSTR)DESKTOP_CLASS_ATOM);
59
60 setWindowProc(windowClass->getWindowProc());
61}
62//******************************************************************************
63//******************************************************************************
64Win32Desktop::~Win32Desktop()
65{
66}
67//******************************************************************************
68//Disabling the desktop is not a good idea (mouse no longer responds)
69//******************************************************************************
70BOOL Win32Desktop::EnableWindow(BOOL fEnable)
71{
72 return TRUE; //of course we succeeded
73}
74//******************************************************************************
75//Dummy window procedure. Does nothing.
76//******************************************************************************
77LRESULT WIN32API DesktopWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
78{
79 switch (message)
80 {
81 case WM_GETTEXT:
82 if (!lParam || !wParam) return 0;
83 ((LPSTR)lParam)[0] = 0;
84 return 0;
85 }
86
87 return 0;
88}
89//******************************************************************************
90//******************************************************************************
91BOOL WIN32API SetDeskWallPaper(LPCSTR filename)
92{
93 dprintf(("USER32: SetDeskWallPaper - empty stub!"));
94
95 return TRUE;
96}
97//******************************************************************************
98//******************************************************************************
99BOOL DESKTOP_Register()
100{
101 WNDCLASSA wndClass;
102
103 ZeroMemory(&wndClass,sizeof(WNDCLASSA));
104 wndClass.style = CS_GLOBALCLASS;
105 wndClass.lpfnWndProc = (WNDPROC)DesktopWndProc;
106 wndClass.cbClsExtra = 0;
107 wndClass.cbWndExtra = 0;
108 wndClass.hCursor = (HCURSOR)IDC_ARROWA;
109 wndClass.hbrBackground = 0;
110 wndClass.lpszClassName = DESKTOP_CLASS_NAMEA;
111
112 return RegisterClassA(&wndClass);
113}
114//******************************************************************************
115//******************************************************************************
116BOOL DESKTOP_Unregister()
117{
118 if (GlobalFindAtomA(DESKTOP_CLASS_NAMEA))
119 return UnregisterClassA(DESKTOP_CLASS_NAMEA,(HINSTANCE)NULL);
120 else return FALSE;
121}
122//******************************************************************************
123//******************************************************************************
Note: See TracBrowser for help on using the repository browser.