static void SetWindowTitle(void) { char *title; title = M_StringReplace(PACKAGE_NAME " Setup ver " PACKAGE_VERSION, "Doom", GetGameTitle()); TXT_SetDesktopTitle(title); free(title); }
/* Exported for the windows message loop only */ static void GAPI_WinPAINT(_THIS, HDC hdc) { if(bShowTaskBar) { //Blank /*RECT rect; HBRUSH brush; rect.left = 0; rect.top = 0; rect.right = sdlWindowSize.right; rect.bottom = sdlWindowSize.bottom - (26 + 24); brush = CreateSolidBrush(RGB(255, 255, 255)); FillRect(hdc, &rect, brush); DeleteObject(brush);*/ //Bitmap if(srcBitmap) { int topBorder, bottomBorder; HDC mdc = CreateCompatibleDC(hdc); SelectObject(mdc, srcBitmap); GetTopBottomBorder(&topBorder, &bottomBorder); BitBlt(hdc, 0, 0, sdlWindowSize.right, sdlWindowSize.bottom - (topBorder + bottomBorder), mdc, 0, topBorder, SRCCOPY); DeleteDC(mdc); } //Refresh navigation bar SHFullScreen(SDL_Window, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON); SDL_WM_SetCaption(GetGameTitle(), NULL); } /*else if(backBufer) { videoBuffer = GXBeginDraw(); memcpy(videoBuffer + this->hidden->m_nBufferStartOffset, backBufer, (this->hidden->m_nBufferEndOffset - this->hidden->m_nBufferStartOffset + 1) * 2); GXEndDraw(); }*/ }
int GAPI_ShowTaskBar() { if(!bShowTaskBar) { int topBorder, bottomBorder; RECT rc; //Take screen shot CreateBitMap(); //Need close the GAPI to give key control back to the system CloseGAPI(); //ShowWindow(SDL_Window, SW_HIDE); SHFullScreen(SDL_Window, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON); bShowTaskBar = 1; GetTopBottomBorder(&topBorder, &bottomBorder); SDL_WM_SetCaption(GetGameTitle(), NULL); SHDoneButton(SDL_Window, SHDB_HIDE); { //http://forum.soft32.com/pda/SHCreateMenuBar-resource-file-ftopict47431.html SHMENUBARINFO cbi; memset(&cbi, 0, sizeof(SHMENUBARINFO)); menuBar = NULL; cbi.cbSize = sizeof(SHMENUBARINFO); cbi.hwndParent = SDL_Window; cbi.hInstRes = SDL_Instance; cbi.nToolBarId = IDR_MENUBAR; //cbi.dwFlags = /*SHCMBF_EMPTYBAR |*/ SHCMBF_HIDESIPBUTTON | SHCMBF_HMENU; //Don't use this with the Smartphone menu if(SHCreateMenuBar(&cbi)) { menuBar = (HMENU)cbi.hwndMB; } } //http://msdn.microsoft.com/en-us/library/aa453694.aspx SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, FALSE); MoveWindow(SDL_Window, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE); //Show the game menu, but not the incoming call menu SetWindowPos(GetForegroundWindow(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); //Show incoming call window SetWindowPos(SDL_Window, HWND_NOTOPMOST, /*0, 0, 1, 1*/sdlWindowSize.left, sdlWindowSize.top + topBorder, sdlWindowSize.right, sdlWindowSize.bottom - (topBorder + bottomBorder), SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW); //Allow to show the incomming call window if(menuBar) writeDebugInfo("GAPI_ShowTaskBar Menu Ok"); else { char buf[64]; sprintf(buf, "GAPI_ShowTaskBar No Menu, Error: %ld", GetLastError()); writeDebugInfo(buf); } return 1; } return 0; }