| 1 | /* $Id: windowword.cpp,v 1.9 2001-01-14 17:15:47 sandervl Exp $ */ | 
|---|
| 2 |  | 
|---|
| 3 | /* | 
|---|
| 4 | * Win32 Get/SetWindowLong/Word user32 API functions for OS/2 | 
|---|
| 5 | * | 
|---|
| 6 | * Copyright 1998-1999 Sander van Leeuwen | 
|---|
| 7 | * | 
|---|
| 8 | * | 
|---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT | 
|---|
| 10 | * | 
|---|
| 11 | */ | 
|---|
| 12 | #include <os2win.h> | 
|---|
| 13 | #include <misc.h> | 
|---|
| 14 |  | 
|---|
| 15 | #include <win32wbase.h> | 
|---|
| 16 |  | 
|---|
| 17 | #define DBG_LOCALLOG    DBG_windowword | 
|---|
| 18 | #include "dbglocal.h" | 
|---|
| 19 |  | 
|---|
| 20 | //****************************************************************************** | 
|---|
| 21 | //****************************************************************************** | 
|---|
| 22 | LONG WIN32API SetWindowLongA(HWND hwnd, int nIndex, LONG  lNewLong) | 
|---|
| 23 | { | 
|---|
| 24 | Win32BaseWindow *window; | 
|---|
| 25 |  | 
|---|
| 26 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 27 | if(window) | 
|---|
| 28 | { | 
|---|
| 29 | return window->SetWindowLongA(nIndex,lNewLong); | 
|---|
| 30 | } | 
|---|
| 31 | else { | 
|---|
| 32 | dprintf(("SetWindowLongA %d %x; window %x not found!", nIndex, lNewLong, hwnd)); | 
|---|
| 33 | } | 
|---|
| 34 | return 0; | 
|---|
| 35 | } | 
|---|
| 36 | //****************************************************************************** | 
|---|
| 37 | //****************************************************************************** | 
|---|
| 38 | LONG WIN32API SetWindowLongW(HWND hwnd, int nIndex, LONG  lNewLong) | 
|---|
| 39 | { | 
|---|
| 40 | Win32BaseWindow *window; | 
|---|
| 41 |  | 
|---|
| 42 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 43 | if(window) | 
|---|
| 44 | { | 
|---|
| 45 | return window->SetWindowLongA(nIndex,lNewLong, TRUE); | 
|---|
| 46 | } | 
|---|
| 47 | else { | 
|---|
| 48 | dprintf(("SetWindowLongW; window %x not found!", hwnd)); | 
|---|
| 49 | } | 
|---|
| 50 | return 0; | 
|---|
| 51 | } | 
|---|
| 52 | //****************************************************************************** | 
|---|
| 53 | //****************************************************************************** | 
|---|
| 54 | WORD WIN32API GetWindowWord(HWND hwnd, int nIndex) | 
|---|
| 55 | { | 
|---|
| 56 | Win32BaseWindow *window; | 
|---|
| 57 |  | 
|---|
| 58 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 59 | if(window) | 
|---|
| 60 | { | 
|---|
| 61 | return window->GetWindowWord(nIndex); | 
|---|
| 62 | } | 
|---|
| 63 | else | 
|---|
| 64 | { | 
|---|
| 65 | dprintf(("GetWindowWord; window %x not found!", hwnd)); | 
|---|
| 66 | } | 
|---|
| 67 | return 0; | 
|---|
| 68 | } | 
|---|
| 69 | //****************************************************************************** | 
|---|
| 70 | //****************************************************************************** | 
|---|
| 71 | WORD WIN32API SetWindowWord(HWND hwnd, int nIndex, WORD arg3) | 
|---|
| 72 | { | 
|---|
| 73 | Win32BaseWindow *window; | 
|---|
| 74 |  | 
|---|
| 75 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 76 | if(window) | 
|---|
| 77 | { | 
|---|
| 78 | return window->SetWindowWord(nIndex, arg3); | 
|---|
| 79 | } | 
|---|
| 80 | else | 
|---|
| 81 | { | 
|---|
| 82 | dprintf(("SetWindowWord; window %x not found!", hwnd)); | 
|---|
| 83 | } | 
|---|
| 84 | return 0; | 
|---|
| 85 | } | 
|---|
| 86 | //****************************************************************************** | 
|---|
| 87 | //****************************************************************************** | 
|---|
| 88 | LONG WIN32API GetWindowLongA(HWND hwnd, int nIndex) | 
|---|
| 89 | { | 
|---|
| 90 | Win32BaseWindow *window; | 
|---|
| 91 |  | 
|---|
| 92 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 93 | if(window) | 
|---|
| 94 | { | 
|---|
| 95 | return window->GetWindowLongA(nIndex); | 
|---|
| 96 | } | 
|---|
| 97 | else | 
|---|
| 98 | { | 
|---|
| 99 | dprintf(("GetWindowLongA; window %x (%d) not found!", hwnd, nIndex)); | 
|---|
| 100 | } | 
|---|
| 101 | return 0; | 
|---|
| 102 | } | 
|---|
| 103 | //****************************************************************************** | 
|---|
| 104 | //****************************************************************************** | 
|---|
| 105 | LONG WIN32API GetWindowLongW(HWND hwnd, int nIndex) | 
|---|
| 106 | { | 
|---|
| 107 | Win32BaseWindow *window; | 
|---|
| 108 |  | 
|---|
| 109 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 110 | if(window) | 
|---|
| 111 | { | 
|---|
| 112 | return window->GetWindowLongA(nIndex, TRUE); | 
|---|
| 113 | } | 
|---|
| 114 | else | 
|---|
| 115 | { | 
|---|
| 116 | dprintf(("GetWindowLongW; window %x not found!", hwnd)); | 
|---|
| 117 | } | 
|---|
| 118 | return 0; | 
|---|
| 119 | } | 
|---|
| 120 | //****************************************************************************** | 
|---|
| 121 | //****************************************************************************** | 
|---|