Changeset 392 for trunk/src


Ignore:
Timestamp:
Jul 25, 1999, 5:51:57 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes; Solitaire now starts

Location:
trunk/src/user32/new
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/defwndproc.cpp

    r391 r392  
    1 /* $Id: defwndproc.cpp,v 1.3 1999-07-25 09:19:21 sandervl Exp $ */
     1/* $Id: defwndproc.cpp,v 1.4 1999-07-25 15:51:55 sandervl Exp $ */
    22
    33/*
     
    1212#include "user32.h"
    1313#include "syscolor.h"
     14#include "win32wnd.h"
    1415
    1516#ifdef DEBUG
     
    2122LRESULT WIN32API DefWindowProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    2223{
    23 #ifdef DEBUG
    24 ////    WriteLog("DEFWNDPROC ");
    25 ////    WriteLog("*DWP*");
    26 #endif
    27     switch(Msg)
    28     {
    29     case WM_SETREDRAW: //Open32 does not set the visible flag
    30         if(wParam)
    31                 SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    32         else    SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    33 
    34         return 0; //TODO
    35 
    36     case WM_NCCREATE:
    37         return(TRUE);
    38 
    39     case WM_CTLCOLORMSGBOX:
    40     case WM_CTLCOLOREDIT:
    41     case WM_CTLCOLORLISTBOX:
    42     case WM_CTLCOLORBTN:
    43     case WM_CTLCOLORDLG:
    44     case WM_CTLCOLORSTATIC:
    45     case WM_CTLCOLORSCROLLBAR:
    46          SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    47          SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    48          return GetSysColorBrush(COLOR_BTNFACE);
    49 
    50     case WM_PARENTNOTIFY:
    51         return 0;
    52 
    53     case WM_MOUSEACTIVATE:
    54     {
    55         DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
    56         DWORD dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    57         dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", hwnd, GetMsgText(HIWORD(lParam))));
    58         if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
    59         {
    60             LRESULT rc = SendMessageA(GetParent(hwnd), WM_MOUSEACTIVATE, wParam, lParam );
    61             if(rc)  return rc;
    62         }
    63         return (LOWORD(lParam) == HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE;
    64     }
    65     case WM_SETCURSOR:
    66     {
    67         DWORD dwStyle = GetWindowLongA(hwnd, GWL_STYLE);
    68         DWORD dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
    69         dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", hwnd, GetMsgText(HIWORD(lParam))));
    70         if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
    71         {
    72             LRESULT rc = SendMessageA(GetParent(hwnd), WM_SETCURSOR, wParam, lParam);
    73             if(rc)  return rc;
    74         }
    75         return 1;
    76     }
    77     case WM_MOUSEMOVE:
    78         return 0;
    79 
    80     case WM_ERASEBKGND:
    81     case WM_ICONERASEBKGND:
    82         return 0;
    83 
    84     case WM_NCLBUTTONDOWN:
    85     case WM_NCLBUTTONUP:
    86     case WM_NCLBUTTONDBLCLK:
    87     case WM_NCRBUTTONUP:
    88     case WM_NCRBUTTONDOWN:
    89     case WM_NCRBUTTONDBLCLK:
    90     case WM_NCMBUTTONDOWN:
    91     case WM_NCMBUTTONUP:
    92     case WM_NCMBUTTONDBLCLK:
    93         return 0;           //TODO: Send WM_SYSCOMMAND if required
    94 
    95     case WM_NCHITTEST: //TODO:
    96         return 0;
    97 
    98     default:
    99         return 1;
     24  Win32Window *window;
     25
     26    window = Win32Window::GetWindowFromHandle(hwnd);
     27    if(!window) {
     28        dprintf(("DefWindowProcA, window %x not found", hwnd));
     29        return 0;
     30    }
     31    return window->DefWindowProcA(Msg, wParam, lParam);
     32}
     33//******************************************************************************
     34//******************************************************************************
     35LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
     36{
     37  Win32Window *window;
     38
     39    window = Win32Window::GetWindowFromHandle(hwnd);
     40    if(!window) {
     41        dprintf(("DefWindowProcW, window %x not found", hwnd));
     42        return 0;
     43    }
     44    return window->DefWindowProcW(Msg, wParam, lParam);
     45}
     46//******************************************************************************
     47//******************************************************************************
     48LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
     49{
     50#ifdef DEBUG
     51////    WriteLog("*DDP*");
     52#endif
     53    switch(Msg) {
     54        case WM_SETREDRAW: //Open32 does not set the visible flag
     55                if(wParam)
     56                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
     57                else
     58                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
     59                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
     60        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
     61                return(TRUE);
     62        case WM_CTLCOLORMSGBOX:
     63        case WM_CTLCOLOREDIT:
     64        case WM_CTLCOLORLISTBOX:
     65        case WM_CTLCOLORBTN:
     66        case WM_CTLCOLORDLG:
     67        case WM_CTLCOLORSTATIC:
     68        case WM_CTLCOLORSCROLLBAR:
     69                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
     70                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     71                return GetSysColorBrush(COLOR_BTNFACE);
     72
     73    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
     74        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     75        return 0;
     76
     77        default:
     78                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    10079    }
    10180}
     
    10382//NOTE: Unicode msg translation!
    10483//******************************************************************************
    105 LRESULT WIN32API DefWindowProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    106 {
    107 #ifdef DEBUG
    108 ////    WriteLog("*DWPW*");
    109 #endif
    110     switch(Msg) {
    111         case WM_SETREDRAW: //Open32 does not set the visible flag
    112                 if(wParam)
    113                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    114                 else
    115                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    116                 return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
    117         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    118                 return(TRUE);
    119         case WM_CTLCOLORMSGBOX:
    120         case WM_CTLCOLOREDIT:
    121         case WM_CTLCOLORLISTBOX:
    122         case WM_CTLCOLORBTN:
    123         case WM_CTLCOLORDLG:
    124         case WM_CTLCOLORSTATIC:
    125         case WM_CTLCOLORSCROLLBAR:
    126                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    127                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    128                 return GetSysColorBrush(COLOR_BTNFACE);
    129 
    130     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    131         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
    132         return 0;
    133 
    134         default:
    135                 return O32_DefWindowProc(hwnd, Msg, wParam, lParam);
    136     }
    137 }
    138 //******************************************************************************
    139 //******************************************************************************
    140 LRESULT WIN32API DefDlgProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    141 {
    142 #ifdef DEBUG
    143 ////    WriteLog("*DDP*");
    144 #endif
    145     switch(Msg) {
    146         case WM_SETREDRAW: //Open32 does not set the visible flag
    147                 if(wParam)
    148                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    149                 else
    150                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    151                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    152         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    153                 return(TRUE);
    154         case WM_CTLCOLORMSGBOX:
    155         case WM_CTLCOLOREDIT:
    156         case WM_CTLCOLORLISTBOX:
    157         case WM_CTLCOLORBTN:
    158         case WM_CTLCOLORDLG:
    159         case WM_CTLCOLORSTATIC:
    160         case WM_CTLCOLORSCROLLBAR:
    161                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    162                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    163                 return GetSysColorBrush(COLOR_BTNFACE);
    164 
    165     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    166         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
    167         return 0;
    168 
    169         default:
    170                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
     84LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
     85{
     86#ifdef DEBUG
     87////    WriteLog("*DDPW*");
     88#endif
     89    switch(Msg) {
     90        case WM_SETREDRAW: //Open32 does not set the visible flag
     91                if(wParam)
     92                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
     93                else
     94                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
     95                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
     96        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
     97                return(TRUE);
     98        case WM_CTLCOLORMSGBOX:
     99        case WM_CTLCOLOREDIT:
     100        case WM_CTLCOLORLISTBOX:
     101        case WM_CTLCOLORBTN:
     102        case WM_CTLCOLORDLG:
     103        case WM_CTLCOLORSTATIC:
     104        case WM_CTLCOLORSCROLLBAR:
     105                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
     106                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     107                return GetSysColorBrush(COLOR_BTNFACE);
     108
     109    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
     110        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     111        return 0;
     112
     113        default:
     114                return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
     115    }
     116}
     117//******************************************************************************
     118//******************************************************************************
     119LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
     120{
     121#ifdef DEBUG
     122////    WriteLog("*DFP*");
     123#endif
     124    switch(Msg) {
     125        case WM_SETREDRAW: //Open32 does not set the visible flag
     126                if(wParam)
     127                  SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
     128                else
     129                  SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
     130                return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
     131        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
     132                return(TRUE);
     133        case WM_CTLCOLORMSGBOX:
     134        case WM_CTLCOLOREDIT:
     135        case WM_CTLCOLORLISTBOX:
     136        case WM_CTLCOLORBTN:
     137        case WM_CTLCOLORDLG:
     138        case WM_CTLCOLORSTATIC:
     139        case WM_CTLCOLORSCROLLBAR:
     140                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
     141                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     142                return GetSysColorBrush(COLOR_BTNFACE);
     143
     144    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
     145        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
     146        return 0;
     147
     148        default:
     149                return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
    171150    }
    172151}
     
    174153//NOTE: Unicode msg translation!
    175154//******************************************************************************
    176 LRESULT WIN32API DefDlgProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    177 {
    178 #ifdef DEBUG
    179 ////    WriteLog("*DDPW*");
    180 #endif
    181     switch(Msg) {
    182         case WM_SETREDRAW: //Open32 does not set the visible flag
    183                 if(wParam)
    184                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    185                 else
    186                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    187                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    188         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    189                 return(TRUE);
    190         case WM_CTLCOLORMSGBOX:
    191         case WM_CTLCOLOREDIT:
    192         case WM_CTLCOLORLISTBOX:
    193         case WM_CTLCOLORBTN:
    194         case WM_CTLCOLORDLG:
    195         case WM_CTLCOLORSTATIC:
    196         case WM_CTLCOLORSCROLLBAR:
    197                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    198                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    199                 return GetSysColorBrush(COLOR_BTNFACE);
    200 
    201     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    202         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
    203         return 0;
    204 
    205         default:
    206                 return O32_DefDlgProc(hwnd, Msg, wParam, lParam);
    207     }
    208 }
    209 //******************************************************************************
    210 //******************************************************************************
    211 LRESULT WIN32API DefFrameProcA(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
    212 {
    213 #ifdef DEBUG
    214 ////    WriteLog("*DFP*");
     155LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
     156{
     157#ifdef DEBUG
     158////    WriteLog("*DFPW*");
    215159#endif
    216160    switch(Msg) {
     
    243187}
    244188//******************************************************************************
     189//******************************************************************************
     190LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
     191{
     192#ifdef DEBUG
     193////    WriteLog("*DMP*");
     194#endif
     195    switch(Msg) {
     196        case WM_SETREDRAW: //Open32 does not set the visible flag
     197                if(wParam)
     198                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
     199                else
     200                  SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
     201                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
     202        case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
     203                return(TRUE);
     204        case WM_CTLCOLORMSGBOX:
     205        case WM_CTLCOLOREDIT:
     206        case WM_CTLCOLORLISTBOX:
     207        case WM_CTLCOLORBTN:
     208        case WM_CTLCOLORDLG:
     209        case WM_CTLCOLORSTATIC:
     210        case WM_CTLCOLORSCROLLBAR:
     211                SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
     212                SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     213                return GetSysColorBrush(COLOR_BTNFACE);
     214
     215    case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
     216        dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
     217        return 0;
     218
     219        default:
     220                return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
     221    }
     222}
     223//******************************************************************************
    245224//NOTE: Unicode msg translation!
    246225//******************************************************************************
    247 LRESULT WIN32API DefFrameProcW(HWND hwndFrame, HWND hwndClient, UINT Msg, WPARAM wParam, LPARAM lParam)
    248 {
    249 #ifdef DEBUG
    250 ////    WriteLog("*DFPW*");
    251 #endif
    252     switch(Msg) {
    253         case WM_SETREDRAW: //Open32 does not set the visible flag
    254                 if(wParam)
    255                   SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) | WS_VISIBLE);
    256                 else
    257                   SetWindowLongA (hwndClient, GWL_STYLE, GetWindowLongA (hwndClient, GWL_STYLE) & ~WS_VISIBLE);
    258                 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
    259         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    260                 return(TRUE);
    261         case WM_CTLCOLORMSGBOX:
    262         case WM_CTLCOLOREDIT:
    263         case WM_CTLCOLORLISTBOX:
    264         case WM_CTLCOLORBTN:
    265         case WM_CTLCOLORDLG:
    266         case WM_CTLCOLORSTATIC:
    267         case WM_CTLCOLORSCROLLBAR:
    268                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    269                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    270                 return GetSysColorBrush(COLOR_BTNFACE);
    271 
    272     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    273         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwndFrame));
    274         return 0;
    275 
    276         default:
    277                 return O32_DefFrameProc(hwndFrame, hwndClient, Msg, wParam, lParam);
    278     }
    279 }
    280 //******************************************************************************
    281 //******************************************************************************
    282 LRESULT WIN32API DefMDIChildProcA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    283 {
    284 #ifdef DEBUG
    285 ////    WriteLog("*DMP*");
    286 #endif
    287     switch(Msg) {
    288         case WM_SETREDRAW: //Open32 does not set the visible flag
    289                 if(wParam)
    290                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) | WS_VISIBLE);
    291                 else
    292                   SetWindowLongA (hwnd, GWL_STYLE, GetWindowLongA (hwnd, GWL_STYLE) & ~WS_VISIBLE);
    293                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    294         case WM_NCCREATE://SvL: YAOFM (yet another open32 feature missing)
    295                 return(TRUE);
    296         case WM_CTLCOLORMSGBOX:
    297         case WM_CTLCOLOREDIT:
    298         case WM_CTLCOLORLISTBOX:
    299         case WM_CTLCOLORBTN:
    300         case WM_CTLCOLORDLG:
    301         case WM_CTLCOLORSTATIC:
    302         case WM_CTLCOLORSCROLLBAR:
    303                 SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
    304                 SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
    305                 return GetSysColorBrush(COLOR_BTNFACE);
    306 
    307     case WM_PARENTNOTIFY: //Open32 doesn't like receiving those!!
    308         dprintf(("DefWndProc: WM_PARENTNOTIFY for %x", hwnd));
    309         return 0;
    310 
    311         default:
    312                 return O32_DefMDIChildProc(hwnd, Msg, wParam, lParam);
    313     }
    314 }
    315 //******************************************************************************
    316 //NOTE: Unicode msg translation!
    317 //******************************************************************************
    318226LRESULT WIN32API DefMDIChildProcW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    319227{
  • trunk/src/user32/new/makefile

    r387 r392  
    1 # $Id: makefile,v 1.19 1999-07-24 17:10:25 cbratschi Exp $
     1# $Id: makefile,v 1.20 1999-07-25 15:51:55 sandervl Exp $
    22
    33#
     
    3333        oslibutil.obj oslibmsg.obj windlg.obj \
    3434        winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \
    35         nativerc.obj oslibres.obj
     35        nativerc.obj oslibres.obj winnonclient.obj
    3636
    3737
     
    108108oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h
    109109
     110winnonclient.obj: winnonclient.cpp
     111
    110112clean:
    111113        $(RM) *.obj *.lib *.dll *~ *.map *.pch
  • trunk/src/user32/new/oslibgdi.cpp

    r389 r392  
    1 /* $Id: oslibgdi.cpp,v 1.6 1999-07-25 08:19:05 sandervl Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.7 1999-07-25 15:51:55 sandervl Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    159159HDC OSLibWinGetPS(HWND hwnd)
    160160{
     161  if(hwnd == OSLIB_HWND_DESKTOP)
     162        hwnd = HWND_DESKTOP;
     163
    161164  return (HDC)WinGetPS(hwnd);
    162165}
  • trunk/src/user32/new/pmwindow.cpp

    r391 r392  
    1 /* $Id: pmwindow.cpp,v 1.14 1999-07-25 09:19:21 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.15 1999-07-25 15:51:56 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    473473            keyflags |= KEY_PREVDOWN;
    474474        }
     475        if(fl & KC_DEADKEY) {
     476            keyflags |= KEY_DEADKEY;
     477        }
    475478        if(win32wnd->MsgChar(SHORT1FROMMP(mp2), CHAR3FROMMP(mp1), CHAR4FROMMP(mp1), vkey, keyflags)) {
    476479            goto RunDefWndProc;
     
    499502    }
    500503
     504    case WM_QUERYWINDOWPARAMS:
     505    {
     506     PWNDPARAMS wndpars = (PWNDPARAMS)mp1;
     507     ULONG textlen;
     508     PSZ   wintext;
     509
     510        if(wndpars->fsStatus & (WPM_CCHTEXT | WPM_TEXT)) {
     511            if(wndpars->fsStatus & WPM_CCHTEXT)
     512                wndpars->cchText = win32wnd->MsgGetTextLength();
     513            if(wndpars->fsStatus & WPM_TEXT)
     514                wndpars->pszText = win32wnd->MsgGetText();
     515            return (MRESULT)TRUE;
     516        }
     517        goto RunDefWndProc;
     518    }
     519
    501520    case WM_PAINT:
    502521        dprintf(("OS2: WM_PAINT %x", hwnd));
     
    515534    case WM_SYSVALUECHANGED:
    516535    case WM_CALCVALIDRECTS:
    517     case WM_QUERYWINDOWPARAMS:
    518536    case WM_SETSELECTION:
    519537    case WM_PPAINT:
  • trunk/src/user32/new/user32.cpp

    r391 r392  
    1 /* $Id: user32.cpp,v 1.10 1999-07-25 09:19:21 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.11 1999-07-25 15:51:56 sandervl Exp $ */
    22
    33/*
     
    258258{
    259259//    ddprintf(("USER32:  CopyRect\n"));
    260     if (!lprcDst || !lprcSrc) return FALSE;
     260    if (!lprcDst || !lprcSrc) {
     261        SetLastError(ERROR_INVALID_PARAMETER);
     262        return FALSE;
     263    }
    261264
    262265    memcpy(lprcDst,lprcSrc,sizeof(RECT));
  • trunk/src/user32/new/win32wnd.cpp

    r391 r392  
    1 /* $Id: win32wnd.cpp,v 1.21 1999-07-25 09:19:22 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.22 1999-07-25 15:51:56 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    3131#include <oslibres.h>
    3232#include <winres.h>
     33#include "syscolor.h"
    3334
    3435#define HAS_DLGFRAME(style,exStyle) \
     
    6061{
    6162  isUnicode        = FALSE;
    62 
    63   windowName       = NULL;
     63  fCreated         = FALSE;
     64
     65  memset(windowNameA, 0, MAX_WINDOW_NAMELENGTH);
     66  memset(windowNameW, 0, MAX_WINDOW_NAMELENGTH*sizeof(WCHAR));
    6467  wndNameLength    = 0;
    65 
    66   windowText       = NULL;;
    67   wndTextLength    = 0;
    6868
    6969  userWindowLong   = NULL;;
     
    115115  if(Win32Hwnd)
    116116        HMHandleFree(Win32Hwnd & 0xFFFF);
    117   if(windowName)
    118         free(windowName);
    119   if(windowText)
    120         free(windowText);
    121117  if(userWindowLong)
    122118        free(userWindowLong);
     
    248244  if ((cs->style & WS_CHILD) && cs->hwndParent)
    249245  {
    250     SetParent(cs->hwndParent);
     246        SetParent(cs->hwndParent);
    251247  }
    252248  else
    253249  {
    254250        if (!cs->hwndParent) {
    255                 owner = NULL;
     251            owner = NULL;
    256252        }
    257253        else
    258254        {
    259         owner = GetWindowFromHandle(cs->hwndParent);
    260                 if(owner == NULL)
    261                 {
    262                         dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
    263                         return FALSE;
    264                 }
     255            owner = GetWindowFromHandle(cs->hwndParent);
     256            if(owner == NULL)
     257            {
     258                dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
     259                return FALSE;
     260            }
    265261        }
    266262  }
     
    361357        return FALSE;
    362358  }
     359
    363360  if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
    364361        dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
     
    412409        if( (SendInternalMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 )
    413410        {
     411            if(!(flags & WIN_NEED_SIZE)) {
     412                SendMessageA(WM_SIZE, SIZE_RESTORED,
     413                                MAKELONG(rectClient.right-rectClient.left,
     414                                         rectClient.bottom-rectClient.top));
     415                SendMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
     416            }
    414417            SetWindowPos(HWND_TOP, rectClient.left, rectClient.top,
    415418                         rectClient.right-rectClient.left,
    416419                         rectClient.bottom-rectClient.top,
    417420                         SWP_NOACTIVATE);
    418 
    419421            if (cs->style & WS_VISIBLE) ShowWindow( sw );
    420422
     
    425427                HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
    426428#endif
     429            fCreated = TRUE;
    427430            SetLastError(0);
    428431            return TRUE;
     
    606609                                   MinMax.ptMinTrackSize.y );
    607610
    608     if (maxSize) *maxSize = MinMax.ptMaxSize;
    609     if (maxPos) *maxPos = MinMax.ptMaxPosition;
    610     if (minTrack) *minTrack = MinMax.ptMinTrackSize;
    611     if (maxTrack) *maxTrack = MinMax.ptMaxTrackSize;
     611    if (maxSize)    *maxSize = MinMax.ptMaxSize;
     612    if (maxPos)     *maxPos  = MinMax.ptMaxPosition;
     613    if (minTrack)   *minTrack = MinMax.ptMinTrackSize;
     614    if (maxTrack)   *maxTrack = MinMax.ptMaxTrackSize;
    612615}
    613616/***********************************************************************
     
    619622 * when calcValidRect is TRUE.
    620623 */
    621 LONG Win32Window::SendNCCalcSize(BOOL calcValidRect,
    622                             RECT *newWindowRect, RECT *oldWindowRect,
    623                             RECT *oldClientRect, WINDOWPOS *winpos,
    624                             RECT *newClientRect )
     624LONG Win32Window::SendNCCalcSize(BOOL calcValidRect, RECT *newWindowRect, RECT *oldWindowRect,
     625                                 RECT *oldClientRect, WINDOWPOS *winpos,
     626                                 RECT *newClientRect )
    625627{
    626628   NCCALCSIZE_PARAMS params;
     
    632634   {
    633635        winposCopy = *winpos;
    634     params.rgrc[1] = *oldWindowRect;
    635     params.rgrc[2] = *oldClientRect;
    636     params.lppos = &winposCopy;
     636        params.rgrc[1] = *oldWindowRect;
     637        params.rgrc[2] = *oldClientRect;
     638        params.lppos = &winposCopy;
    637639   }
    638640   result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect,
     
    723725 WORD fwSizeType = 0;
    724726
     727    if(fCreated == FALSE) {//Solitaire crashes if it receives a WM_SIZE during CreateWindowEx (normal or our fault?)
     728        return 1;
     729    }
     730
    725731    if(fMinimize) {
    726732            fwSizeType = SIZE_MINIMIZED;
     
    747753}
    748754//******************************************************************************
    749 //TODO: virtual key translation & extended keyboard bit
     755//TODO: virtual key & (possibly) scancode translation, extended keyboard bit & Unicode
    750756//******************************************************************************
    751757ULONG Win32Window::MsgChar(ULONG cmd, ULONG repeatcnt, ULONG scancode, ULONG vkey, ULONG keyflags)
     
    761767    if(keyflags & KEY_UP)
    762768        lParam |= (1<<31);
    763     dprintf(("WM_CHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
    764     return SendInternalMessageA(WM_CHAR, cmd, lParam);
     769    if(keyflags & KEY_DEADKEY) {
     770        dprintf(("WM_DEADCHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
     771        return SendInternalMessageA(WM_DEADCHAR, cmd, lParam);
     772    }
     773    else {
     774        dprintf(("WM_CHAR: %x %x %08x", OS2Hwnd, cmd, lParam));
     775        return SendInternalMessageA(WM_CHAR, cmd, lParam);
     776    }
    765777}
    766778//******************************************************************************
     
    832844ULONG Win32Window::MsgMouseMove(ULONG keystate, ULONG x, ULONG y)
    833845{
    834 ULONG winstate = 0;
    835 
    836   if(keystate & WMMOVE_LBUTTON)
    837     winstate |= MK_LBUTTON;
    838   if(keystate & WMMOVE_RBUTTON)
    839     winstate |= MK_RBUTTON;
    840   if(keystate & WMMOVE_MBUTTON)
    841     winstate |= MK_MBUTTON;
    842   if(keystate & WMMOVE_SHIFT)
    843     winstate |= MK_SHIFT;
    844   if(keystate & WMMOVE_CTRL)
    845     winstate |= MK_CONTROL;
    846 
    847    return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y));
     846 ULONG winstate = 0;
     847
     848    if(keystate & WMMOVE_LBUTTON)
     849        winstate |= MK_LBUTTON;
     850    if(keystate & WMMOVE_RBUTTON)
     851        winstate |= MK_RBUTTON;
     852    if(keystate & WMMOVE_MBUTTON)
     853        winstate |= MK_MBUTTON;
     854    if(keystate & WMMOVE_SHIFT)
     855        winstate |= MK_SHIFT;
     856    if(keystate & WMMOVE_CTRL)
     857        winstate |= MK_CONTROL;
     858
     859    return SendInternalMessageA(WM_MOUSEMOVE, keystate, MAKELONG(x, y));
    848860}
    849861//******************************************************************************
     
    851863ULONG Win32Window::MsgPaint(ULONG tmp1, ULONG tmp2)
    852864{
    853   return SendInternalMessageA(WM_PAINT, 0, 0);
     865    return SendInternalMessageA(WM_PAINT, 0, 0);
    854866}
    855867//******************************************************************************
     
    866878ULONG Win32Window::MsgSetText(LPSTR lpsz, LONG cch)
    867879{
    868   if(isUnicode) {
    869         return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
    870   }
    871   else  return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
     880    if(isUnicode) {
     881            return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz);
     882    }
     883    else    return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);
     884}
     885//******************************************************************************
     886//TODO: in- or excluding terminating 0?
     887//******************************************************************************
     888ULONG Win32Window::MsgGetTextLength()
     889{
     890    return SendInternalMessageA(WM_GETTEXTLENGTH, 0, 0);
     891}
     892//******************************************************************************
     893//******************************************************************************
     894char *Win32Window::MsgGetText()
     895{
     896    if(isUnicode) {
     897        SendInternalMessageW(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameW);
     898    }
     899    else {
     900        SendInternalMessageA(WM_GETTEXT, MAX_WINDOW_NAMELENGTH, (LPARAM)windowNameA);
     901    }
     902    return windowNameA;
     903}
     904//******************************************************************************
     905//******************************************************************************
     906LRESULT Win32Window::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam)
     907{
     908    switch(Msg)
     909    {
     910    case WM_GETTEXTLENGTH:
     911        return wndNameLength;
     912
     913    case WM_GETTEXT:   //TODO: SS_ICON controls
     914        strncpy((LPSTR)lParam, windowNameA, wParam);
     915        return min(wndNameLength, wParam);
     916
     917    case WM_SETTEXT:
     918        return 0;
     919
     920    case WM_SETREDRAW:
     921        if(wParam)
     922                SetWindowLongA (GWL_STYLE, GetWindowLongA (GWL_STYLE) | WS_VISIBLE);
     923        else    SetWindowLongA (GWL_STYLE, GetWindowLongA (GWL_STYLE) & ~WS_VISIBLE);
     924
     925        return 0; //TODO
     926
     927    case WM_NCCREATE:
     928        return(TRUE);
     929
     930    case WM_CTLCOLORMSGBOX:
     931    case WM_CTLCOLOREDIT:
     932    case WM_CTLCOLORLISTBOX:
     933    case WM_CTLCOLORBTN:
     934    case WM_CTLCOLORDLG:
     935    case WM_CTLCOLORSTATIC:
     936    case WM_CTLCOLORSCROLLBAR:
     937         SetBkColor((HDC)wParam, GetSysColor(COLOR_WINDOW));
     938         SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
     939         return GetSysColorBrush(COLOR_BTNFACE);
     940
     941    case WM_PARENTNOTIFY:
     942        return 0;
     943
     944    case WM_MOUSEACTIVATE:
     945    {
     946        DWORD dwStyle = GetWindowLongA(GWL_STYLE);
     947        DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);
     948        dprintf(("DefWndProc: WM_MOUSEACTIVATE for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam))));
     949        if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
     950        {
     951            if(getParent()) {
     952                LRESULT rc = getParent()->SendMessageA(WM_MOUSEACTIVATE, wParam, lParam );
     953                if(rc)  return rc;
     954            }
     955        }
     956        return (LOWORD(lParam) == HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE;
     957    }
     958    case WM_SETCURSOR:
     959    {
     960        DWORD dwStyle = GetWindowLongA(GWL_STYLE);
     961        DWORD dwExStyle = GetWindowLongA(GWL_EXSTYLE);
     962        dprintf(("DefWndProc: WM_SETCURSOR for %x Msg %s", Win32Hwnd, GetMsgText(HIWORD(lParam))));
     963        if(dwStyle & WS_CHILD && !(dwExStyle & WS_EX_NOPARENTNOTIFY) )
     964        {
     965            if(getParent()) {
     966                LRESULT rc = getParent()->SendMessageA(WM_SETCURSOR, wParam, lParam);
     967                if(rc)  return rc;
     968            }
     969        }
     970        return 1;
     971    }
     972    case WM_MOUSEMOVE:
     973        return 0;
     974
     975    case WM_ERASEBKGND:
     976    case WM_ICONERASEBKGND:
     977        return 0;
     978
     979    case WM_NCLBUTTONDOWN:
     980    case WM_NCLBUTTONUP:
     981    case WM_NCLBUTTONDBLCLK:
     982    case WM_NCRBUTTONUP:
     983    case WM_NCRBUTTONDOWN:
     984    case WM_NCRBUTTONDBLCLK:
     985    case WM_NCMBUTTONDOWN:
     986    case WM_NCMBUTTONUP:
     987    case WM_NCMBUTTONDBLCLK:
     988        return 0;           //TODO: Send WM_SYSCOMMAND if required
     989
     990    case WM_NCHITTEST: //TODO:
     991        return 0;
     992
     993    default:
     994        return 1;
     995    }
     996}
     997//******************************************************************************
     998//******************************************************************************
     999LRESULT Win32Window::DefWindowProcW(UINT Msg, WPARAM wParam, LPARAM lParam)
     1000{
     1001    switch(Msg)
     1002    {
     1003    case WM_GETTEXTLENGTH:
     1004        return wndNameLength;
     1005
     1006    case WM_GETTEXT:   //TODO: SS_ICON controls
     1007        lstrcpynW((LPWSTR)lParam, windowNameW, wParam);
     1008        return min(wndNameLength, wParam);
     1009
     1010    default:
     1011        return DefWindowProcA(Msg, wParam, lParam);
     1012    }
    8721013}
    8731014//******************************************************************************
     
    8971038                return(0);
    8981039        }
     1040        case WM_SETTEXT: //TODO: Nothing happens if passed to DefWindowProc
     1041                return win32wndproc(getWindowHandle(), WM_SETTEXT, wParam, lParam);
     1042
    8991043        case WM_LBUTTONDOWN:
    9001044        case WM_MBUTTONDOWN:
     
    9371081                return(1);
    9381082        }
     1083        case WM_SETTEXT: //TODO: Nothing happens if passed to DefWindowProc
     1084                return win32wndproc(getWindowHandle(), WM_SETTEXT, wParam, lParam);
     1085
    9391086        case WM_LBUTTONDOWN:
    9401087        case WM_MBUTTONDOWN:
     
    11001247 Win32Resource *winres = (Win32Resource *)hMenu;
    11011248
     1249    dprintf(("SetMenu %x", hMenu));
    11021250    if(HIWORD(winres) == 0) {
    11031251        dprintf(("Win32Window:: Win32Resource *winres == 0"));
    1104     SetLastError(ERROR_INVALID_PARAMETER);
     1252        SetLastError(ERROR_INVALID_PARAMETER);
    11051253        return FALSE;
    11061254    }
  • trunk/src/user32/new/win32wnd.h

    r391 r392  
    1 /* $Id: win32wnd.h,v 1.18 1999-07-25 09:19:22 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.19 1999-07-25 15:51:56 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    4343#define WM_WIN32_POSTMESSAGEA   0x4000
    4444#define WM_WIN32_POSTMESSAGEW   0x4001
     45
     46#define MAX_WINDOW_NAMELENGTH   256
    4547
    4648class Win32Window : private GenericObject, private ChildWindow
     
    7375         ULONG  MsgEraseBackGround(ULONG hps);
    7476         ULONG  MsgSetText(LPSTR lpsz, LONG cch);
     77         ULONG  MsgGetTextLength();
     78         char  *MsgGetText();
    7579
    7680virtual  LONG   SetWindowLongA(int index, ULONG value);
     
    134138       BOOL     PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);
    135139       BOOL     PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);
    136        LRESULT  DefWindowProcA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
    137        LRESULT  DefWindowProcW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
     140       LRESULT  DefWindowProcA(UINT msg, WPARAM wParam, LPARAM lParam);
     141       LRESULT  DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam);
    138142
    139143         void   NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam);
     
    192196
    193197        BOOL    isIcon;
     198        BOOL    fCreated;
    194199
    195200   Win32Window *owner;                 
     
    199204 Win32Resource *iconResource;
    200205
    201         char   *windowName;
     206        char    windowNameA[MAX_WINDOW_NAMELENGTH];
     207        WCHAR   windowNameW[MAX_WINDOW_NAMELENGTH];
    202208        ULONG   wndNameLength;
    203209
    204         char   *windowText;
    205         ULONG   wndTextLength;
    206        
    207210        ULONG  *userWindowLong;
    208211        ULONG   nrUserWindowLong;
     
    277280#define KEY_PREVDOWN            2
    278281#define KEY_UP                  4
     282#define KEY_DEADKEY             8
    279283
    280284#endif //__cplusplus
  • trunk/src/user32/new/window.cpp

    r391 r392  
    1 /* $Id: window.cpp,v 1.10 1999-07-25 09:19:22 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.11 1999-07-25 15:51:57 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    647647#endif
    648648    return O32_FindWindow(arg3, arg4);
    649 }
    650 //******************************************************************************
    651 //******************************************************************************
    652 BOOL WIN32API FlashWindow(HWND hwnd, BOOL fFlash)
    653 {
    654     dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
    655     return OSLibWinFlashWindow(Win32Window::Win32ToOS2Handle(hwnd), fFlash);
    656 }
    657 //******************************************************************************
    658 //******************************************************************************
    659 BOOL WIN32API MoveWindow(HWND arg1, int arg2, int arg3, int arg4, int arg5, BOOL arg6)
    660 {
    661  BOOL rc;
    662 
    663     rc = O32_MoveWindow(arg1, arg2, arg3, arg4, arg5, arg6);
    664     dprintf(("USER32:  MoveWindow %X to (%d,%d) size (%d,%d), repaint = %d returned %d\n", arg1, arg2, arg3, arg4, arg5, arg6, rc));
    665     return(rc);
    666 }
    667 //******************************************************************************
    668 //******************************************************************************
    669 BOOL WIN32API AdjustWindowRect( PRECT arg1, DWORD arg2, BOOL  arg3)
    670 {
    671 #ifdef DEBUG
    672     WriteLog("USER32:  AdjustWindowRect\n");
    673 #endif
    674     return O32_AdjustWindowRect(arg1, arg2, arg3);
    675 }
    676 //******************************************************************************
    677 //******************************************************************************
    678 BOOL WIN32API AdjustWindowRectEx( PRECT arg1, DWORD arg2, BOOL arg3, DWORD  arg4)
    679 {
    680 #ifdef DEBUG
    681     WriteLog("USER32:  AdjustWindowRectEx\n");
    682 #endif
    683     return O32_AdjustWindowRectEx(arg1, arg2, arg3, arg4);
    684 }
    685 //******************************************************************************
    686 //******************************************************************************
    687 BOOL WIN32API ClientToScreen( HWND arg1, PPOINT  arg2)
    688 {
    689 #ifdef DEBUG
    690 ////    WriteLog("USER32:  ClientToScreen\n");
    691 #endif
    692     return O32_ClientToScreen(arg1, arg2);
    693 }
    694 //******************************************************************************
    695 //******************************************************************************
    696 HDWP WIN32API BeginDeferWindowPos( int arg1)
    697 {
    698 #ifdef DEBUG
    699     WriteLog("USER32:  BeginDeferWindowPos\n");
    700 #endif
    701     return O32_BeginDeferWindowPos(arg1);
    702 }
    703 //******************************************************************************
    704 //******************************************************************************
    705 HDWP WIN32API DeferWindowPos( HDWP arg1, HWND arg2, HWND  arg3, int arg4, int arg5, int arg6, int arg7, UINT  arg8)
    706 {
    707 #ifdef DEBUG
    708     WriteLog("USER32:  DeferWindowPos\n");
    709 #endif
    710     return O32_DeferWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
    711 }
    712 //******************************************************************************
    713 //******************************************************************************
    714 HWND WIN32API ChildWindowFromPoint( HWND arg1, POINT  arg2)
    715 {
    716 #ifdef DEBUG
    717     WriteLog("USER32:  ChildWindowFromPoint\n");
    718 #endif
    719     return O32_ChildWindowFromPoint(arg1, arg2);
    720 }
    721 //******************************************************************************
    722 //******************************************************************************
    723 HWND WIN32API ChildWindowFromPointEx(HWND arg1, POINT arg2, UINT uFlags)
    724 {
    725 #ifdef DEBUG
    726     WriteLog("USER32:  ChildWindowFromPointEx, not completely supported!\n");
    727 #endif
    728     return O32_ChildWindowFromPoint(arg1, arg2);
    729 }
    730 //******************************************************************************
    731 //******************************************************************************
    732 BOOL WIN32API CloseWindow(HWND hwnd)
    733 {
    734    Win32Window *window;
    735 
    736     window = Win32Window::GetWindowFromHandle(hwnd);
    737     if(!window) {
    738         dprintf(("CloseWindow, window %x not found", hwnd));
    739         return 0;
    740     }
    741     dprintf(("CloseWindow %x\n", hwnd));
    742     return window->CloseWindow();
    743 }
    744 //******************************************************************************
    745 //******************************************************************************
    746 HWND WIN32API WindowFromDC(HDC hdc)
    747 {
    748 #ifdef DEBUG
    749     WriteLog("USER32:  WindowFromDC\n");
    750 #endif
    751     return O32_WindowFromDC(hdc);
    752 }
    753 //******************************************************************************
    754 //TODO: Does this return handles of hidden or disabled windows?
    755 //******************************************************************************
    756 HWND WIN32API WindowFromPoint( POINT point)
    757 {
    758  HWND hwnd;
    759 
    760     dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
    761     hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
    762     if(hwnd) {
    763         return Win32Window::OS2ToWin32Handle(hwnd);
    764     }
    765     return 0;
    766 }
    767 //******************************************************************************
    768 //******************************************************************************
    769 BOOL WIN32API IsWindowUnicode(HWND hwnd)
    770 {
    771    Win32Window *window;
    772 
    773     window = Win32Window::GetWindowFromHandle(hwnd);
    774     if(!window) {
    775         dprintf(("IsWindowUnicode, window %x not found", hwnd));
    776         return 0;
    777     }
    778     return window->IsUnicode();
    779 }
    780 /*****************************************************************************
    781  * Name      : WORD WIN32API CascadeWindows
    782  * Purpose   : The CascadeWindows function cascades the specified windows or
    783  *             the child windows of the specified parent window.
    784  * Parameters: HWND hwndParent         handle of parent window
    785  *             UINT wHow               types of windows not to arrange
    786  *             CONST RECT * lpRect     rectangle to arrange windows in
    787  *             UINT cKids              number of windows to arrange
    788  *             const HWND FAR * lpKids array of window handles
    789  * Variables :
    790  * Result    : If the function succeeds, the return value is the number of windows arranged.
    791  *             If the function fails, the return value is zero.
    792  * Remark    :
    793  * Status    : UNTESTED STUB
    794  *
    795  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    796  *****************************************************************************/
    797 
    798 WORD WIN32API CascadeWindows(HWND       hwndParent,
    799                              UINT       wHow,
    800                              CONST LPRECT lpRect,
    801                              UINT       cKids,
    802                              const HWND *lpKids)
    803 {
    804   dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
    805          hwndParent,
    806          wHow,
    807          lpRect,
    808          cKids,
    809          lpKids));
    810 
    811   return (0);
    812649}
    813650/*****************************************************************************
     
    845682  return (NULL);
    846683}
     684//******************************************************************************
     685//******************************************************************************
     686BOOL WIN32API FlashWindow(HWND hwnd, BOOL fFlash)
     687{
     688    dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
     689    return OSLibWinFlashWindow(Win32Window::Win32ToOS2Handle(hwnd), fFlash);
     690}
     691//******************************************************************************
     692//******************************************************************************
     693BOOL WIN32API MoveWindow(HWND arg1, int arg2, int arg3, int arg4, int arg5, BOOL arg6)
     694{
     695 BOOL rc;
     696
     697    rc = O32_MoveWindow(arg1, arg2, arg3, arg4, arg5, arg6);
     698    dprintf(("USER32:  MoveWindow %X to (%d,%d) size (%d,%d), repaint = %d returned %d\n", arg1, arg2, arg3, arg4, arg5, arg6, rc));
     699    return(rc);
     700}
     701//******************************************************************************
     702//******************************************************************************
     703BOOL WIN32API ClientToScreen( HWND arg1, PPOINT  arg2)
     704{
     705#ifdef DEBUG
     706////    WriteLog("USER32:  ClientToScreen\n");
     707#endif
     708    return O32_ClientToScreen(arg1, arg2);
     709}
     710//******************************************************************************
     711//******************************************************************************
     712HDWP WIN32API BeginDeferWindowPos( int arg1)
     713{
     714#ifdef DEBUG
     715    WriteLog("USER32:  BeginDeferWindowPos\n");
     716#endif
     717    return O32_BeginDeferWindowPos(arg1);
     718}
     719//******************************************************************************
     720//******************************************************************************
     721HDWP WIN32API DeferWindowPos( HDWP arg1, HWND arg2, HWND  arg3, int arg4, int arg5, int arg6, int arg7, UINT  arg8)
     722{
     723#ifdef DEBUG
     724    WriteLog("USER32:  DeferWindowPos\n");
     725#endif
     726    return O32_DeferWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
     727}
     728//******************************************************************************
     729//******************************************************************************
     730HWND WIN32API ChildWindowFromPoint( HWND arg1, POINT  arg2)
     731{
     732#ifdef DEBUG
     733    WriteLog("USER32:  ChildWindowFromPoint\n");
     734#endif
     735    return O32_ChildWindowFromPoint(arg1, arg2);
     736}
     737//******************************************************************************
     738//******************************************************************************
     739HWND WIN32API ChildWindowFromPointEx(HWND arg1, POINT arg2, UINT uFlags)
     740{
     741#ifdef DEBUG
     742    WriteLog("USER32:  ChildWindowFromPointEx, not completely supported!\n");
     743#endif
     744    return O32_ChildWindowFromPoint(arg1, arg2);
     745}
     746//******************************************************************************
     747//******************************************************************************
     748BOOL WIN32API CloseWindow(HWND hwnd)
     749{
     750   Win32Window *window;
     751
     752    window = Win32Window::GetWindowFromHandle(hwnd);
     753    if(!window) {
     754        dprintf(("CloseWindow, window %x not found", hwnd));
     755        return 0;
     756    }
     757    dprintf(("CloseWindow %x\n", hwnd));
     758    return window->CloseWindow();
     759}
     760//******************************************************************************
     761//TODO: Does this return handles of hidden or disabled windows?
     762//******************************************************************************
     763HWND WIN32API WindowFromPoint( POINT point)
     764{
     765 HWND hwnd;
     766
     767    dprintf(("WindowFromPoint (%d,%d)\n", point.x, point.y));
     768    hwnd = OSLibWinWindowFromPoint(OSLIB_HWND_DESKTOP, (PVOID)&point);
     769    if(hwnd) {
     770        return Win32Window::OS2ToWin32Handle(hwnd);
     771    }
     772    return 0;
     773}
     774//******************************************************************************
     775//******************************************************************************
     776BOOL WIN32API IsWindowUnicode(HWND hwnd)
     777{
     778   Win32Window *window;
     779
     780    window = Win32Window::GetWindowFromHandle(hwnd);
     781    if(!window) {
     782        dprintf(("IsWindowUnicode, window %x not found", hwnd));
     783        return 0;
     784    }
     785    return window->IsUnicode();
     786}
     787/*****************************************************************************
     788 * Name      : WORD WIN32API CascadeWindows
     789 * Purpose   : The CascadeWindows function cascades the specified windows or
     790 *             the child windows of the specified parent window.
     791 * Parameters: HWND hwndParent         handle of parent window
     792 *             UINT wHow               types of windows not to arrange
     793 *             CONST RECT * lpRect     rectangle to arrange windows in
     794 *             UINT cKids              number of windows to arrange
     795 *             const HWND FAR * lpKids array of window handles
     796 * Variables :
     797 * Result    : If the function succeeds, the return value is the number of windows arranged.
     798 *             If the function fails, the return value is zero.
     799 * Remark    :
     800 * Status    : UNTESTED STUB
     801 *
     802 * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
     803 *****************************************************************************/
     804
     805WORD WIN32API CascadeWindows(HWND       hwndParent,
     806                             UINT       wHow,
     807                             CONST LPRECT lpRect,
     808                             UINT       cKids,
     809                             const HWND *lpKids)
     810{
     811  dprintf(("USER32:CascadeWindows(%08xh,%u,%08xh,%u,%08x) not implemented.\n",
     812         hwndParent,
     813         wHow,
     814         lpRect,
     815         cKids,
     816         lpKids));
     817
     818  return (0);
     819}
    847820/*****************************************************************************
    848821 * Name      : BOOL WIN32API SwitchToThisWindow
  • trunk/src/user32/new/wingdi.cpp

    r391 r392  
    1 /* $Id: wingdi.cpp,v 1.7 1999-07-25 09:19:22 sandervl Exp $ */
     1/* $Id: wingdi.cpp,v 1.8 1999-07-25 15:51:57 sandervl Exp $ */
    22/*
    33 * Win32 Window graphics apis for OS/2
     
    6565   window = Win32Window::GetWindowFromHandle(hwnd);
    6666   if(!window) {
    67     dprintf(("GetDC, window %x not found", hwnd));
    68     return 0;
     67        dprintf(("GetDC, window %x not found", hwnd));
     68#ifdef OPEN32_GDI
     69        dprintf(("GetDC %x", hwnd));
     70        return O32_GetDC(0);
     71#else
     72        //desktop window?
     73        dprintf(("GetDC %x", hwnd));
     74        return OSLibWinGetPS(OSLIB_HWND_DESKTOP);
     75#endif
    6976   }
    7077   dprintf(("GetDC %x", hwnd));
     
    8996int WIN32API ReleaseDC(HWND hwnd, HDC hdc)
    9097{
     98    dprintf(("ReleaseDC %x %x", hwnd, hdc));
    9199#ifdef OPEN32_GDI
    92100    return O32_ReleaseDC(hwnd,hdc);
     
    115123//******************************************************************************
    116124//******************************************************************************
     125HWND WIN32API WindowFromDC(HDC hdc)
     126{
     127    dprintf(("USER32:  WindowFromDC\n"));
     128#ifdef OPEN32_GDI
     129    return O32_WindowFromDC(hdc);
     130#else
     131    ?????
     132#endif
     133}
     134//******************************************************************************
     135//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.