| 1 | /* $Id: windowword.cpp,v 1.10 2001-02-03 18:52:03 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 | SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
|
|---|
| 34 | return 0;
|
|---|
| 35 | }
|
|---|
| 36 | }
|
|---|
| 37 | //******************************************************************************
|
|---|
| 38 | //******************************************************************************
|
|---|
| 39 | LONG WIN32API SetWindowLongW(HWND hwnd, int nIndex, LONG lNewLong)
|
|---|
| 40 | {
|
|---|
| 41 | Win32BaseWindow *window;
|
|---|
| 42 |
|
|---|
| 43 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
|---|
| 44 | if(window)
|
|---|
| 45 | {
|
|---|
| 46 | return window->SetWindowLongA(nIndex,lNewLong, TRUE);
|
|---|
| 47 | }
|
|---|
| 48 | else {
|
|---|
| 49 | dprintf(("SetWindowLongW; window %x not found!", hwnd));
|
|---|
| 50 | SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
|
|---|
| 51 | return 0;
|
|---|
| 52 | }
|
|---|
| 53 | }
|
|---|
| 54 | //******************************************************************************
|
|---|
| 55 | //******************************************************************************
|
|---|
| 56 | WORD WIN32API GetWindowWord(HWND hwnd, int nIndex)
|
|---|
| 57 | {
|
|---|
| 58 | Win32BaseWindow *window;
|
|---|
| 59 |
|
|---|
| 60 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
|---|
| 61 | if(window)
|
|---|
| 62 | {
|
|---|
| 63 | return window->GetWindowWord(nIndex);
|
|---|
| 64 | }
|
|---|
| 65 | else
|
|---|
| 66 | {
|
|---|
| 67 | dprintf(("GetWindowWord; window %x not found!", hwnd));
|
|---|
| 68 | SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
|
|---|
| 69 | return 0;
|
|---|
| 70 | }
|
|---|
| 71 | }
|
|---|
| 72 | //******************************************************************************
|
|---|
| 73 | //******************************************************************************
|
|---|
| 74 | WORD WIN32API SetWindowWord(HWND hwnd, int nIndex, WORD arg3)
|
|---|
| 75 | {
|
|---|
| 76 | Win32BaseWindow *window;
|
|---|
| 77 |
|
|---|
| 78 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
|---|
| 79 | if(window)
|
|---|
| 80 | {
|
|---|
| 81 | return window->SetWindowWord(nIndex, arg3);
|
|---|
| 82 | }
|
|---|
| 83 | else
|
|---|
| 84 | {
|
|---|
| 85 | dprintf(("SetWindowWord; window %x not found!", hwnd));
|
|---|
| 86 | SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
|
|---|
| 87 | return 0;
|
|---|
| 88 | }
|
|---|
| 89 | }
|
|---|
| 90 | //******************************************************************************
|
|---|
| 91 | //******************************************************************************
|
|---|
| 92 | LONG WIN32API GetWindowLongA(HWND hwnd, int nIndex)
|
|---|
| 93 | {
|
|---|
| 94 | Win32BaseWindow *window;
|
|---|
| 95 |
|
|---|
| 96 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
|---|
| 97 | if(window)
|
|---|
| 98 | {
|
|---|
| 99 | return window->GetWindowLongA(nIndex);
|
|---|
| 100 | }
|
|---|
| 101 | else
|
|---|
| 102 | {
|
|---|
| 103 | dprintf(("GetWindowLongA; window %x (%d) not found!", hwnd, nIndex));
|
|---|
| 104 | SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
|
|---|
| 105 | return 0;
|
|---|
| 106 | }
|
|---|
| 107 | }
|
|---|
| 108 | //******************************************************************************
|
|---|
| 109 | //******************************************************************************
|
|---|
| 110 | LONG WIN32API GetWindowLongW(HWND hwnd, int nIndex)
|
|---|
| 111 | {
|
|---|
| 112 | Win32BaseWindow *window;
|
|---|
| 113 |
|
|---|
| 114 | window = Win32BaseWindow::GetWindowFromHandle(hwnd);
|
|---|
| 115 | if(window)
|
|---|
| 116 | {
|
|---|
| 117 | return window->GetWindowLongA(nIndex, TRUE);
|
|---|
| 118 | }
|
|---|
| 119 | else
|
|---|
| 120 | {
|
|---|
| 121 | dprintf(("GetWindowLongW; window %x not found!", hwnd));
|
|---|
| 122 | SetLastError(ERROR_INVALID_WINDOW_HANDLE); //verified in NT4, SP6
|
|---|
| 123 | return 0;
|
|---|
| 124 | }
|
|---|
| 125 | }
|
|---|
| 126 | //******************************************************************************
|
|---|
| 127 | //******************************************************************************
|
|---|