/* * BkColorEnumProc - used to change the background color of all MDI children */ BOOL CALLBACK BkColorEnumProc( HWND hwnd, LONG lparam ) { img_node *node; lparam = lparam; if( _wpi_getowner( hwnd ) ) { return( TRUE ); } if( _wpi_isiconic( hwnd ) ) { return( TRUE ); } node = SelectImage( _wpi_getclient( hwnd ) ); if( node == NULL ) { return( TRUE ); } if( node->imgtype == BITMAP_IMG ) { return( TRUE ); } InvalidateRect( _wpi_getclient( hwnd ), NULL, FALSE ); InvalidateRect( node->viewhwnd, NULL, FALSE ); return( TRUE ); } /* BkColorEnumProc */
/* * GridEnumProc - used to grid all the children */ BOOL CALLBACK GridEnumProc( HWND hwnd, LONG lparam ) { lparam = lparam; if( _wpi_getowner( hwnd ) ) { return( 1 ); } if( _wpi_isiconic( hwnd ) ) { return( 1 ); } else { InvalidateRect( _wpi_getclient( hwnd ), NULL, FALSE ); } return( 1 ); } /* GridEnumProc */
/* * ViewEnumProc - enumerate the child windows and show the view window * for each window */ BOOL CALLBACK ViewEnumProc( HWND hwnd, LONG lparam ) { lparam = lparam; if( _wpi_getowner( hwnd ) ) { return( TRUE ); } if( _wpi_isiconic( hwnd ) ) { return( TRUE ); } else { SendMessage( hwnd, UM_SHOWVIEWWINDOW, 0, 0L ); } return( TRUE ); } /* ViewEnumProc */
/* * GridEnumProc - used to grid all the children */ BOOL CALLBACK GridEnumProc( HWND hwnd, LONG lparam ) { HWND frame; lparam = lparam; if ( _wpi_getowner(hwnd) ) { return 1; } if ( _wpi_isiconic(hwnd) ) { return 1; } else { InvalidateRect( _wpi_getclient(hwnd), NULL, FALSE ); } frame = frame; // suppress compiler warnings return 1; } /* GridEnumProc */
/* * GetPosProc - get the position of all the child windows */ BOOL CALLBACK GetPosProc( HWND hwnd, LONG lparam ) { WPI_RECT windowrect; WPI_POINT topleft; // this ends up being bottom left for PM WPI_RECTDIM left; WPI_RECTDIM top; lparam = lparam; #ifdef __OS2_PM__ if( windowIndex >= imageMax ) { return( 0 ); } #endif if( _wpi_getowner( hwnd ) != NULL ) { return( 1 ); } if( _wpi_isiconic( hwnd ) ) { windowCoords[windowIndex].x = -1; windowCoords[windowIndex].y = -1; windowIndex++; return( 1 ); } _wpi_getwindowrect( hwnd, &windowrect ); _wpi_getrectvalues( windowrect, &left, &top, NULL, NULL ); topleft.x = left; topleft.y = top; _wpi_screentoclient( ClientWindow, &topleft ); if( topleft.x < 0 ) { topleft.x = 0; } #ifndef __OS2_PM__ if( topleft.y < 0 ) { topleft.y = 0; } #endif windowCoords[windowIndex] = topleft; windowIndex++; return( 1 ); } /* GetPosProc */
static gui_window *GetToolWnd( HWND hwnd ) { HWND parent; #ifndef __OS2_PM__ parent = _wpi_getparent( hwnd ); if( parent != HWND_DESKTOP ) { return( GUIGetWindow( parent ) ); } #else parent = _wpi_getparent(_wpi_getparent( hwnd )); if( parent == HWND_DESKTOP ) { parent = _wpi_getowner( _wpi_getparent( hwnd ) ); } if( parent != HWND_DESKTOP ) { return( GUIGetWindow( parent ) ); } #endif return( NULL ); }