| 1 | /* $Id: oslibutil.cpp,v 1.3 2000-01-01 14:57:20 cbratschi Exp $ */ | 
|---|
| 2 | /* | 
|---|
| 3 | * Window API utility functions 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 <wprocess.h> | 
|---|
| 15 | #include "oslibutil.h" | 
|---|
| 16 |  | 
|---|
| 17 | //****************************************************************************** | 
|---|
| 18 | //****************************************************************************** | 
|---|
| 19 | HAB GetThreadHAB() | 
|---|
| 20 | { | 
|---|
| 21 | THDB *thdb; | 
|---|
| 22 |  | 
|---|
| 23 | thdb = GetThreadTHDB(); | 
|---|
| 24 | if(thdb) | 
|---|
| 25 | { | 
|---|
| 26 | return (HAB)thdb->hab; | 
|---|
| 27 | } | 
|---|
| 28 |  | 
|---|
| 29 | dprintf(("GetThreadHAB: thdb == NULL!!")); | 
|---|
| 30 | return 0; | 
|---|
| 31 | } | 
|---|
| 32 | //****************************************************************************** | 
|---|
| 33 | //****************************************************************************** | 
|---|
| 34 | void SetThreadHAB(HAB hab) | 
|---|
| 35 | { | 
|---|
| 36 | THDB *thdb; | 
|---|
| 37 |  | 
|---|
| 38 | thdb = GetThreadTHDB(); | 
|---|
| 39 | if(thdb) | 
|---|
| 40 | { | 
|---|
| 41 | thdb->hab = (ULONG)hab; | 
|---|
| 42 | } | 
|---|
| 43 | else  dprintf(("SetThreadHAB: thdb == NULL!!")); | 
|---|
| 44 | } | 
|---|
| 45 | //****************************************************************************** | 
|---|
| 46 | //****************************************************************************** | 
|---|
| 47 | HMQ GetThreadMessageQueue() | 
|---|
| 48 | { | 
|---|
| 49 | THDB *thdb; | 
|---|
| 50 |  | 
|---|
| 51 | thdb = GetThreadTHDB(); | 
|---|
| 52 | if(thdb) | 
|---|
| 53 | { | 
|---|
| 54 | return (HMQ)thdb->hmq; | 
|---|
| 55 | } | 
|---|
| 56 |  | 
|---|
| 57 | dprintf(("GetThreadMessageQueue: thdb == NULL!!")); | 
|---|
| 58 | return 0; | 
|---|
| 59 | } | 
|---|
| 60 | //****************************************************************************** | 
|---|
| 61 | //****************************************************************************** | 
|---|
| 62 | void SetThreadMessageQueue(HMQ hmq) | 
|---|
| 63 | { | 
|---|
| 64 | THDB *thdb; | 
|---|
| 65 |  | 
|---|
| 66 | thdb = GetThreadTHDB(); | 
|---|
| 67 | if(thdb) | 
|---|
| 68 | { | 
|---|
| 69 | thdb->hmq = (ULONG)hmq; | 
|---|
| 70 | } | 
|---|
| 71 | else  dprintf(("SetThreadMessageQueue: thdb == NULL!!")); | 
|---|
| 72 | } | 
|---|
| 73 | //****************************************************************************** | 
|---|
| 74 | //****************************************************************************** | 
|---|
| 75 | DWORD GetThreadMessageExtraInfo() | 
|---|
| 76 | { | 
|---|
| 77 | THDB *thdb; | 
|---|
| 78 |  | 
|---|
| 79 | thdb = GetThreadTHDB(); | 
|---|
| 80 | if(thdb) | 
|---|
| 81 | { | 
|---|
| 82 | return thdb->lParam; | 
|---|
| 83 | } | 
|---|
| 84 |  | 
|---|
| 85 | dprintf(("GetThreadMessageExtraInfo: thdb == NULL!!")); | 
|---|
| 86 | return 0; | 
|---|
| 87 | } | 
|---|
| 88 | //****************************************************************************** | 
|---|
| 89 | //****************************************************************************** | 
|---|
| 90 | DWORD SetThreadMessageExtraInfo(DWORD lParam) | 
|---|
| 91 | { | 
|---|
| 92 | THDB *thdb; | 
|---|
| 93 |  | 
|---|
| 94 | thdb = GetThreadTHDB(); | 
|---|
| 95 | if(thdb) | 
|---|
| 96 | { | 
|---|
| 97 | thdb->lParam = lParam; | 
|---|
| 98 | } | 
|---|
| 99 | else  dprintf(("SetThreadMessageExtraInfo: thdb == NULL!!")); | 
|---|
| 100 | return 0; | 
|---|
| 101 | } | 
|---|