c++ builder:检测活动桌面是否激活

类别:编程语言 点击:0 评论:0 推荐:

 

    前一段时间,小弟编写一个关于壁纸的软件,因为要确认是否启动了Active Desktop,
所以写了下面的代码。或许大家也会用得着.
bool __fastcall TWallFrm::ActiveDesktop(void)
{
        /*检测是否启动了Active Desktop
        是则返回true,否则返回false*/
        HWND hwnd;
        hwnd=FindWindow("Progman",NULL);
        hwnd= FindWindowEx(hwnd,NULL,"SHELLDLL_DefView",NULL);
        hwnd=FindWindowEx(hwnd,NULL,"Internet Explorer_Server",NULL);
        if (hwnd>0)
                return true;
        else
                return false;
}/*以上代码在c++ Builder5/Win98 SE下编译通过*/
                                                                                稻草人
                                                                              2001.6.30

本文地址:http://com.8s8s.com/it/it30271.htm