Changeset 8848 for trunk/src/user32/window.cpp
- Timestamp:
- Jul 8, 2002, 12:51:01 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/window.cpp
r8846 r8848 1 /* $Id: window.cpp,v 1.12 4 2002-07-08 10:21:55sandervl Exp $ */1 /* $Id: window.cpp,v 1.125 2002-07-08 10:51:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 727 727 //****************************************************************************** 728 728 //****************************************************************************** 729 HWND WINAPI GetAncestor( HWND hwnd, UINT type ) 730 { 731 HWND hwndAncestor = 0; 732 733 if (type == GA_PARENT) 734 { 735 LONG dwStyle = GetWindowLongW( hwnd, GWL_STYLE ); 736 if(dwStyle & WS_CHILD) { 737 hwndAncestor = GetParent(hwnd); 738 } 739 //else no child -> no parent (GetParent returns owner otherwise!) 740 return hwndAncestor; 741 } 742 dprintf(("Unsupported type %d", type)); 743 return 0; 744 } 745 //****************************************************************************** 746 //****************************************************************************** 729 747 HWND WIN32API SetFocus(HWND hwnd) 730 748 { … … 741 759 } 742 760 743 window = Win32BaseWindow::GetWindowFromHandle(hwnd);744 if(!window) {745 dprintf(("SetFocus, window %x not found", hwnd));746 SetLastError(ERROR_INVALID_WINDOW_HANDLE);747 return 0;748 }749 750 761 //SetFocus is not allowed for minimized or disabled windows (this window 751 762 //or any parent) … … 760 771 return 0; 761 772 } 762 parent = Get Parent(hwndTop);773 parent = GetAncestor(hwndTop, GA_PARENT); 763 774 if (!parent || parent == GetDesktopWindow()) break; 764 775 hwndTop = parent; 776 } 777 778 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 779 if(!window) { 780 dprintf(("SetFocus, window %x not found", hwnd)); 781 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 782 return 0; 765 783 } 766 784
Note:
See TracChangeset
for help on using the changeset viewer.