Changeset 5586 for trunk/src/user32/window.cpp
- Timestamp:
- Apr 25, 2001, 10:53:39 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/window.cpp
r5496 r5586 1 /* $Id: window.cpp,v 1.9 3 2001-04-12 14:04:33sandervl Exp $ */1 /* $Id: window.cpp,v 1.94 2001-04-25 20:53:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 653 653 { 654 654 Win32BaseWindow *window; 655 DWORD dwStyle; 655 656 656 657 window = Win32BaseWindow::GetWindowFromHandle(hwnd); … … 661 662 } 662 663 dprintf(("IsWindowEnabled %x", hwnd)); 663 return window->IsWindowEnabled(); 664 } 665 //****************************************************************************** 666 //****************************************************************************** 667 BOOL WIN32API IsWindowVisible( HWND hwnd) 668 { 669 Win32BaseWindow *window; 670 BOOL rc; 671 672 if (hwnd) 673 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 674 else 675 window = windowDesktop; 664 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 665 if(dwStyle & WS_DISABLED) { 666 return FALSE; 667 } 668 return TRUE; 669 } 670 //****************************************************************************** 671 //****************************************************************************** 672 BOOL WIN32API IsWindowVisible(HWND hwnd) 673 { 674 Win32BaseWindow *window; 675 BOOL ret; 676 HWND hwndParent; 677 DWORD dwStyle; 678 679 if(!hwnd) {//TODO: verify in NT! 680 dprintf(("IsWindowVisible DESKTOP returned TRUE")); 681 return TRUE; //desktop is always visible 682 } 683 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 684 676 685 if(!window) { 677 686 dprintf(("IsWindowVisible, window %x not found", hwnd)); … … 679 688 return 0; 680 689 } 681 rc = window->IsWindowVisible(); 682 dprintf(("IsWindowVisible %x returned %d", hwnd, rc)); 683 return rc; 684 } 685 //****************************************************************************** 686 //****************************************************************************** 687 HWND WIN32API SetFocus (HWND hwnd) 690 //check visibility of this window 691 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 692 if(!(dwStyle & WS_VISIBLE)) { 693 ret = FALSE; 694 goto end; 695 } 696 ret = TRUE; 697 698 //check visibility of parents 699 hwndParent = GetParent(hwnd); 700 while(hwndParent) { 701 dwStyle = GetWindowLongA(hwndParent, GWL_STYLE); 702 if(!(dwStyle & WS_VISIBLE)) { 703 dprintf(("IsWindowVisible %x returned FALSE (parent %x invisible)", hwnd, hwndParent)); 704 return FALSE; 705 } 706 hwndParent = GetParent(hwndParent); 707 } 708 709 end: 710 dprintf(("IsWindowVisible %x returned %d", hwnd, ret)); 711 return ret; 712 } 713 //****************************************************************************** 714 //****************************************************************************** 715 HWND WIN32API SetFocus(HWND hwnd) 688 716 { 689 717 HWND lastFocus, lastFocus_W, hwnd_O;
Note:
See TracChangeset
for help on using the changeset viewer.