Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否加上检测全屏时不弹出程序的功能,全屏检测代码如下: #7

Open
GoogleCodeExporter opened this issue Jun 1, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

作者你好,能否加上检测全屏时不弹出程序的功能,我看了��
�激活程序的代码应该是这里:
main.cpp中:
void LaunchyWidget::showLaunchy(bool noFade)
{
    if(IsFullScreen())//检测全屏
           return;
    shouldDonate();
    showAlternatives(false);

        ......

    plugins.showLaunchy();
}
全屏检测代码如下:
//检查当前是否有程序处于全屏独占模式 
bool IsFullScreen() 
{ 
    //声明4个句柄,用于获取屏幕角落的的四个点 
    HWND pWnd1=NULL;
    HWND pWnd2=NULL;
    HWND pWnd3=NULL;
    HWND pWnd4=NULL; 
    //获取当前屏幕分辨率 Width 
    int iCx=GetSystemMetrics(SM_CXSCREEN); 
    //获取当前屏幕分辨率 Height 
    int iCy=GetSystemMetrics(SM_CYSCREEN); 
    POINT pt1; 
    pt1.x=1; 
    pt1.y=1; 
    POINT pt2; 
    pt2.x=1; 
    pt2.y=iCy-1; 
    POINT pt3; 
    pt3.x=iCx-1; 
    pt3.y=1; 
    POINT pt4; 
    pt4.x=iCx-1; 
    pt4.y=iCy-1; 
    pWnd1=WindowFromPoint(pt1); 
    pWnd2=WindowFromPoint(pt2); 
    pWnd3=WindowFromPoint(pt3); 
    pWnd4=WindowFromPoint(pt4); 

    if (pWnd1==pWnd2 && pWnd2==pWnd3 && pWnd3==pWnd4) 
    { 
        //printf("全屏窗口句柄:%d\n",pWnd1);
        return true;
    }
    return false;
}

可能还要#include 
<windows.h>,QT的开发环境我不太了解,不知道还要加点什么引�
��不?

Original issue reported on code.google.com by [email protected] on 10 Aug 2012 at 2:01

@GoogleCodeExporter
Copy link
Author

hi  
因为已经很久没有在windows上开发了,所以现在也没有了编译�
��境。如果你能编译的话,能否给我一个编译好的版本? 
谢谢你的支持。

Original comment by [email protected] on 10 Aug 2012 at 2:12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant