| 1 | /* $Id: winswitch.cpp,v 1.1 2000-01-01 14:57:39 cbratschi Exp $ */ | 
|---|
| 2 | /* | 
|---|
| 3 | * WinSwitch control | 
|---|
| 4 | * | 
|---|
| 5 | * Copyright 1999 Christoph Bratschi | 
|---|
| 6 | * | 
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 8 | * | 
|---|
| 9 | * Status:  stub | 
|---|
| 10 | * Version: stub | 
|---|
| 11 | */ | 
|---|
| 12 | #include <stdlib.h> | 
|---|
| 13 | #include <os2win.h> | 
|---|
| 14 | #include "controls.h" | 
|---|
| 15 | #include "winswitch.h" | 
|---|
| 16 |  | 
|---|
| 17 | LRESULT WINAPI WinSwitchWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam) | 
|---|
| 18 | { | 
|---|
| 19 | return DefWindowProcA(hwnd,message,wParam,lParam); | 
|---|
| 20 | } | 
|---|
| 21 | //****************************************************************************** | 
|---|
| 22 | //****************************************************************************** | 
|---|
| 23 | BOOL WINSWITCH_Register() | 
|---|
| 24 | { | 
|---|
| 25 | WNDCLASSA wndClass; | 
|---|
| 26 |  | 
|---|
| 27 | //SvL: Don't check this now | 
|---|
| 28 | //    if (GlobalFindAtomA(WINSWITCHCLASSNAME)) return FALSE; | 
|---|
| 29 |  | 
|---|
| 30 | ZeroMemory(&wndClass,sizeof(WNDCLASSA)); | 
|---|
| 31 | wndClass.style         = CS_GLOBALCLASS; | 
|---|
| 32 | wndClass.lpfnWndProc   = (WNDPROC)WinSwitchWndProc; | 
|---|
| 33 | wndClass.cbClsExtra    = 0; | 
|---|
| 34 | wndClass.cbWndExtra    = sizeof(WINSWITCH_INFO); | 
|---|
| 35 | wndClass.hCursor       = LoadCursorA(0,IDC_ARROWA); | 
|---|
| 36 | wndClass.hbrBackground = (HBRUSH)0; | 
|---|
| 37 | wndClass.lpszClassName = WINSWITCHCLASSNAME; | 
|---|
| 38 |  | 
|---|
| 39 | return RegisterClassA(&wndClass); | 
|---|
| 40 | } | 
|---|
| 41 | //****************************************************************************** | 
|---|
| 42 | //****************************************************************************** | 
|---|
| 43 | BOOL WINSWITCH_Unregister() | 
|---|
| 44 | { | 
|---|
| 45 | if (GlobalFindAtomA(WINSWITCHCLASSNAME)) | 
|---|
| 46 | return UnregisterClassA(WINSWITCHCLASSNAME,(HINSTANCE)NULL); | 
|---|
| 47 | else return FALSE; | 
|---|
| 48 | } | 
|---|
| 49 | //****************************************************************************** | 
|---|
| 50 | //****************************************************************************** | 
|---|
| 51 |  | 
|---|