hzg392622955 2016-05-06 07:54 采纳率: 0%
浏览 1770

win32全屏覆盖任务栏无效

void EnterFullScreen(WindowInfo* win, bool presentation)
{
HWND hwnd = FindWindow(NULL, L"DetailShow");
HWND hwnd1 = ::GetParent(win->hwndFrame);
if (!hwnd)
return;

if (!HasPermission(Perm_FullscreenAccess) || gPluginMode)
    return;

if ((presentation ? win->presentation : win->isFullScreen) || !IsWindowVisible(hwnd))
    return;

AssertCrash(presentation ? !win->isFullScreen : !win->presentation);
if (presentation) {
    AssertCrash(win->ctrl);
    if (!win->IsDocLoaded())
        return;

    if (IsZoomed(hwnd))
        win->windowStateBeforePresentation = WIN_STATE_MAXIMIZED;
    else
        win->windowStateBeforePresentation = WIN_STATE_NORMAL;
    win->presentation = PM_ENABLED;

    SetTimer(win->hwndCanvas, HIDE_CURSOR_TIMER_ID, HIDE_CURSOR_DELAY_IN_MS, nullptr);
}
else {
    win->isFullScreen = true;
}

// ToC and Favorites sidebars are hidden when entering presentation mode
// TODO: make showFavorites a per-window pref
bool showFavoritesTmp = gGlobalPrefs->showFavorites;
if (presentation && (win->tocVisible || gGlobalPrefs->showFavorites)) {
    SetSidebarVisibility(win, false, false);
}

long ws = GetWindowLong(hwnd, GWL_STYLE);
if (!presentation || !win->isFullScreen)
    win->nonFullScreenWindowStyle = ws;
// remove window styles that add to non-client area
ws &= ~(WS_CAPTION | WS_THICKFRAME);
ws |= WS_MAXIMIZE;

win->nonFullScreenFrameRect = WindowRect(hwnd);
RectI rect = GetFullscreenRect(hwnd);

SetMenu(hwnd, nullptr);
ShowWindow(win->hwndReBar, SW_HIDE);
ShowWindow(win->hwndTabBar, SW_HIDE);
ShowWindow(win->hwndCaption, SW_HIDE);
SetWindowLong(hwnd, GWL_STYLE, ws);
SetWindowPos(hwnd, nullptr, rect.x, rect.y, rect.dx, rect.dy, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER);
ShowWindow(hwnd, SW_SHOWMAXIMIZED);
if (presentation)
    win->ctrl->SetPresentationMode(true);

// Make sure that no toolbar/sidebar keeps the focus
SetFocus(hwnd);
// restore gGlobalPrefs->showFavorites changed by SetSidebarVisibility()
gGlobalPrefs->showFavorites = showFavoritesTmp;

}

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-05-06 15:44
    关注

    用setwindowpos swp_topmost将你的窗口置顶看看

    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题