00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <os2win.h>
00013 #include <misc.h>
00014
00015 #include <win32wbase.h>
00016
00017 #define DBG_LOCALLOG DBG_windowword
00018 #include "dbglocal.h"
00019
00020
00021
00022 LONG WIN32API SetWindowLongA(HWND hwnd, int nIndex, LONG lNewLong)
00023 {
00024 Win32BaseWindow *window;
00025 LONG ret;
00026
00027 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00028 if(window)
00029 {
00030 ret = window->SetWindowLong(nIndex,lNewLong, TYPE_ASCII);
00031 RELEASE_WNDOBJ(window);
00032 return ret;
00033 }
00034 else {
00035 dprintf(("SetWindowLongA %d %x; window %x not found!", nIndex, lNewLong, hwnd));
00036 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
00037 return 0;
00038 }
00039 }
00040
00041
00042 LONG WIN32API SetWindowLongW(HWND hwnd, int nIndex, LONG lNewLong)
00043 {
00044 Win32BaseWindow *window;
00045 LONG ret;
00046
00047 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00048 if(window)
00049 {
00050 ret = window->SetWindowLong(nIndex,lNewLong, TYPE_UNICODE);
00051 RELEASE_WNDOBJ(window);
00052 return ret;
00053 }
00054 else {
00055 dprintf(("SetWindowLongW; window %x not found!", hwnd));
00056 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
00057 return 0;
00058 }
00059 }
00060
00061
00062 WORD WIN32API GetWindowWord(HWND hwnd, int nIndex)
00063 {
00064 Win32BaseWindow *window;
00065 LONG ret;
00066
00067 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00068 if(window)
00069 {
00070 ret = window->GetWindowWord(nIndex);
00071 RELEASE_WNDOBJ(window);
00072 return ret;
00073 }
00074 else
00075 {
00076 dprintf(("GetWindowWord; window %x not found!", hwnd));
00077 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
00078 return 0;
00079 }
00080 }
00081
00082
00083 WORD WIN32API SetWindowWord(HWND hwnd, int nIndex, WORD arg3)
00084 {
00085 Win32BaseWindow *window;
00086 LONG ret;
00087
00088 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00089 if(window)
00090 {
00091 ret = window->SetWindowWord(nIndex, arg3);
00092 RELEASE_WNDOBJ(window);
00093 return ret;
00094 }
00095 else
00096 {
00097 dprintf(("SetWindowWord; window %x not found!", hwnd));
00098 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
00099 return 0;
00100 }
00101 }
00102
00103
00104 LONG WIN32API GetWindowLongA(HWND hwnd, int nIndex)
00105 {
00106 Win32BaseWindow *window;
00107 LONG ret;
00108
00109 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00110 if(window)
00111 {
00112 ret = window->GetWindowLong(nIndex, TYPE_ASCII);
00113 RELEASE_WNDOBJ(window);
00114 return ret;
00115 }
00116 else
00117 {
00118 dprintf(("GetWindowLongA; window %x (%d) not found!", hwnd, nIndex));
00119 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
00120 return 0;
00121 }
00122 }
00123
00124
00125 LONG WIN32API GetWindowLongW(HWND hwnd, int nIndex)
00126 {
00127 Win32BaseWindow *window;
00128 LONG ret;
00129
00130 window = Win32BaseWindow::GetWindowFromHandle(hwnd);
00131 if(window)
00132 {
00133 ret = window->GetWindowLong(nIndex, TYPE_UNICODE);
00134 RELEASE_WNDOBJ(window);
00135 return ret;
00136 }
00137 else
00138 {
00139 dprintf(("GetWindowLongW; window %x not found!", hwnd));
00140 SetLastError(ERROR_INVALID_WINDOW_HANDLE);
00141 return 0;
00142 }
00143 }
00144
00145