void SizePerfmonComponents (void) { RECT rectClient ; int xWidth, yHeight ; int yToolbarHeight ; int yStatusHeight ; int yViewHeight ; GetClientRect (hWndMain, &rectClient) ; xWidth = rectClient.right - rectClient.left ; yHeight = rectClient.bottom - rectClient.top ; if (Options.bToolbar) { SendMessage (hWndToolbar, WM_SIZE, 0, 0L) ; } yToolbarHeight = Options.bToolbar ? (WindowHeight (hWndToolbar) - 1) : 0 ; yStatusHeight = Options.bStatusbar ? StatusHeight (hWndStatus) : 0 ; if (Options.bStatusbar) { if (yToolbarHeight + yStatusHeight > yHeight) { // too small to display both toolbar and status bar // just display part of the status bar yStatusHeight = yHeight - yToolbarHeight ; } MoveWindow (hWndStatus, 0, yHeight - yStatusHeight, xWidth, yStatusHeight, TRUE) ; //WindowInvalidate (hWndStatus) ; } //WindowInvalidate (hWndMain) ; WindowShow (hWndStatus, Options.bStatusbar) ; WindowShow (hWndToolbar, Options.bToolbar) ; yViewHeight = yHeight - yStatusHeight - yToolbarHeight ; MoveWindow (hWndGraph, 0, yToolbarHeight, xWidth, yViewHeight, TRUE) ; MoveWindow (hWndAlert, 0, yToolbarHeight, xWidth, yViewHeight, TRUE) ; MoveWindow (hWndLog, 0, yToolbarHeight, xWidth, yViewHeight, TRUE) ; MoveWindow (hWndReport, 0, yToolbarHeight, xWidth, yViewHeight, TRUE) ; } // SizePerfmonComponents
void RunPostChangeStatus() { int NewHeight = StatusHeight(); if (OldHeight != NewHeight) { RECT winrect; GetWindowRect(hFrameWnd,&winrect); winrect.bottom += NewHeight-OldHeight; MoveOK=timeGetTime(); SetWindowRect(hFrameWnd,&winrect); } }
static int NormalPut() { int Ret=0; RECT Dest={0,0,0,0}; if (DispPrim==NULL) return 1; if (DispBuff==NULL) return 1; // buffer surface --> primary surface GetClientScreenRect(hFrameWnd,&Dest); Dest.bottom-=StatusHeight(); // Normal Ret=DispPrim->Blt(&Dest,DispBuff,NULL,DDBLT_WAIT,NULL); if (Ret<0) return 1; return 0; }
static int OverlayPut() { // Show the overlay RECT Dest={0,0,0,0}; DDOVERLAYFX ofx; if (DispOver==NULL) return 1; GetClientScreenRect(hFrameWnd,&Dest); Dest.bottom-=StatusHeight(); if (memcmp(&LastOver,&Dest,sizeof(Dest))==0) return 0; // Overlay already in the right place memset(&ofx,0,sizeof(ofx)); ofx.dwSize=sizeof(ofx); ofx.dckDestColorkey.dwColorSpaceLowValue =OverlayColor; ofx.dckDestColorkey.dwColorSpaceHighValue=OverlayColor; DispOver->UpdateOverlay(NULL,DispPrim,&Dest, DDOVER_SHOW|DDOVER_DDFX|DDOVER_KEYDESTOVERRIDE,&ofx); LastOver=Dest; return 0; }
void RunPreChangeStatus() { OldHeight = StatusHeight(); }