source: trunk/src/user32/setwindow.cpp@ 215

Last change on this file since 215 was 215, checked in by sandervl, 26 years ago

Spy and window message changes

File size: 3.7 KB
Line 
1/* $Id: setwindow.cpp,v 1.1 1999-06-26 13:21:12 sandervl Exp $ */
2
3/*
4 * Win32 Get/SetWindowLong/Word user32 API functions for OS/2
5 *
6 * Copyright 1998 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 <wndproc.h>
16#include <wndclass.h>
17
18//******************************************************************************
19//******************************************************************************
20LONG WIN32API SetWindowLongA(HWND hwnd, int nIndex, LONG arg3)
21{
22 LONG rc;
23
24 dprintf(("USER32: SetWindowLongA %X %d %X\n", hwnd, nIndex, arg3));
25 if(nIndex == GWL_WNDPROC || nIndex == DWL_DLGPROC) {
26 Win32WindowProc *wndproc = Win32WindowProc::FindProc(hwnd);
27 if(wndproc == NULL) {//created with system class and app wants to change the handler
28 dprintf(("USER32: ERROR: SetWindowLong new WindowProc for system class\n"));
29 //SvL: 26/06/99 Should no longer be possible
30 DebugInt3();
31 return(0);
32 }
33 else {
34 if(!(nIndex == DWL_DLGPROC && wndproc->IsWindow() == TRUE)) {
35 rc = (LONG)wndproc->GetWin32Callback();
36 dprintf(("USER32: SetWindowLong change WindowProc %X to %X\n", rc, arg3));
37 wndproc->SetWin32Callback((WNDPROC)arg3);
38 return(rc);
39 }
40 //else window that accesses it's normal window data
41 }
42 }
43 return O32_SetWindowLong(hwnd, nIndex, arg3);
44}
45//******************************************************************************
46//TODO: Is this always correct? (GWL_ID: window identifier??)
47//******************************************************************************
48LONG WIN32API SetWindowLongW(HWND arg1, int arg2, LONG arg3)
49{
50 dprintf(("USER32: SetWindowLongW %X %d %X\n", arg1, arg2, arg3));
51 return SetWindowLongA(arg1, arg2, arg3);
52}
53//******************************************************************************
54//******************************************************************************
55WORD WIN32API GetWindowWord( HWND arg1, int arg2)
56{
57#ifdef DEBUG
58 WriteLog("USER32: GetWindowWord\n");
59#endif
60 return O32_GetWindowWord(arg1, arg2);
61}
62//******************************************************************************
63//******************************************************************************
64WORD WIN32API SetWindowWord( HWND arg1, int arg2, WORD arg3)
65{
66 dprintf(("USER32: SetWindowWord\n"));
67 return O32_SetWindowWord(arg1, arg2, arg3);
68}
69//******************************************************************************
70//******************************************************************************
71LONG WIN32API GetWindowLongA(HWND hwnd, int nIndex)
72{
73 LONG rc;
74
75 if(nIndex == GWL_WNDPROC || nIndex == DWL_DLGPROC) {
76#ifdef DEBUG
77 WriteLog("USER32: GetWindowLong %X %d\n", hwnd, nIndex);
78#endif
79 Win32WindowProc *window = Win32WindowProc::FindProc(hwnd);
80 if(window && !(nIndex == DWL_DLGPROC && window->IsWindow() == TRUE)) {
81 return (LONG)window->GetWin32Callback();
82 }
83 }
84 rc = O32_GetWindowLong(hwnd, nIndex);
85 return(rc);
86}
87//******************************************************************************
88//******************************************************************************
89LONG WIN32API GetWindowLongW( HWND arg1, int arg2)
90{
91#ifdef DEBUG
92 WriteLog("USER32: GetWindowLongW\n");
93#endif
94 return GetWindowLongA(arg1, arg2); //class procedures..
95}
96//******************************************************************************
97//******************************************************************************
Note: See TracBrowser for help on using the repository browser.