| 1 | /* $Id: windowword.cpp,v 1.7 2000-01-18 20:11:12 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 | //****************************************************************************** | 
|---|
| 18 | //****************************************************************************** | 
|---|
| 19 | LONG WIN32API SetWindowLongA(HWND hwnd, int nIndex, LONG  lNewLong) | 
|---|
| 20 | { | 
|---|
| 21 | Win32BaseWindow *window; | 
|---|
| 22 |  | 
|---|
| 23 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 24 | if(window) | 
|---|
| 25 | { | 
|---|
| 26 | return window->SetWindowLongA(nIndex,lNewLong); | 
|---|
| 27 | } | 
|---|
| 28 | else { | 
|---|
| 29 | dprintf(("SetWindowLongA; window %x not found!", hwnd)); | 
|---|
| 30 | } | 
|---|
| 31 | return 0; | 
|---|
| 32 | } | 
|---|
| 33 | //****************************************************************************** | 
|---|
| 34 | //****************************************************************************** | 
|---|
| 35 | LONG WIN32API SetWindowLongW(HWND hwnd, int nIndex, LONG  lNewLong) | 
|---|
| 36 | { | 
|---|
| 37 | Win32BaseWindow *window; | 
|---|
| 38 |  | 
|---|
| 39 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 40 | if(window) | 
|---|
| 41 | { | 
|---|
| 42 | return window->SetWindowLongA(nIndex,lNewLong, TRUE); | 
|---|
| 43 | } | 
|---|
| 44 | else { | 
|---|
| 45 | dprintf(("SetWindowLongW; window %x not found!", hwnd)); | 
|---|
| 46 | } | 
|---|
| 47 | return 0; | 
|---|
| 48 | } | 
|---|
| 49 | //****************************************************************************** | 
|---|
| 50 | //****************************************************************************** | 
|---|
| 51 | WORD WIN32API GetWindowWord(HWND hwnd, int nIndex) | 
|---|
| 52 | { | 
|---|
| 53 | Win32BaseWindow *window; | 
|---|
| 54 |  | 
|---|
| 55 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 56 | if(window) | 
|---|
| 57 | { | 
|---|
| 58 | return window->GetWindowWord(nIndex); | 
|---|
| 59 | } | 
|---|
| 60 | else | 
|---|
| 61 | { | 
|---|
| 62 | dprintf(("GetWindowWord; window %x not found!", hwnd)); | 
|---|
| 63 | } | 
|---|
| 64 | return 0; | 
|---|
| 65 | } | 
|---|
| 66 | //****************************************************************************** | 
|---|
| 67 | //****************************************************************************** | 
|---|
| 68 | WORD WIN32API SetWindowWord(HWND hwnd, int nIndex, WORD arg3) | 
|---|
| 69 | { | 
|---|
| 70 | Win32BaseWindow *window; | 
|---|
| 71 |  | 
|---|
| 72 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 73 | if(window) | 
|---|
| 74 | { | 
|---|
| 75 | return window->SetWindowWord(nIndex, arg3); | 
|---|
| 76 | } | 
|---|
| 77 | else | 
|---|
| 78 | { | 
|---|
| 79 | dprintf(("SetWindowWord; window %x not found!", hwnd)); | 
|---|
| 80 | } | 
|---|
| 81 | return 0; | 
|---|
| 82 | } | 
|---|
| 83 | //****************************************************************************** | 
|---|
| 84 | //****************************************************************************** | 
|---|
| 85 | LONG WIN32API GetWindowLongA(HWND hwnd, int nIndex) | 
|---|
| 86 | { | 
|---|
| 87 | Win32BaseWindow *window; | 
|---|
| 88 |  | 
|---|
| 89 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 90 | if(window) | 
|---|
| 91 | { | 
|---|
| 92 | return window->GetWindowLongA(nIndex); | 
|---|
| 93 | } | 
|---|
| 94 | else | 
|---|
| 95 | { | 
|---|
| 96 | dprintf(("GetWindowLongA; window %x (%d) not found!", hwnd, nIndex)); | 
|---|
| 97 | } | 
|---|
| 98 | return 0; | 
|---|
| 99 | } | 
|---|
| 100 | //****************************************************************************** | 
|---|
| 101 | //****************************************************************************** | 
|---|
| 102 | LONG WIN32API GetWindowLongW(HWND hwnd, int nIndex) | 
|---|
| 103 | { | 
|---|
| 104 | Win32BaseWindow *window; | 
|---|
| 105 |  | 
|---|
| 106 | window = Win32BaseWindow::GetWindowFromHandle(hwnd); | 
|---|
| 107 | if(window) | 
|---|
| 108 | { | 
|---|
| 109 | return window->GetWindowLongA(nIndex, TRUE); | 
|---|
| 110 | } | 
|---|
| 111 | else | 
|---|
| 112 | { | 
|---|
| 113 | dprintf(("GetWindowLongW; window %x not found!", hwnd)); | 
|---|
| 114 | } | 
|---|
| 115 | return 0; | 
|---|
| 116 | } | 
|---|
| 117 | //****************************************************************************** | 
|---|
| 118 | //****************************************************************************** | 
|---|