C ++ Builder: Detect whether the activity desktop is activated

zhaozj2021-02-17  58

For a few more, the younger brother prepared a software about wallpapers because it was confirmed whether Active Desktop was launched.

So write the following code. Maybe everyone will use.

BOOL __FASTCALL TWALLFRM :: ActiveDesktop (Void)

{

/ * Detects whether Active Desktop is started

If returns true, otherwise returns 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;

} / * The above code is compiled under C Builder5 / Win98 SE * /

scarecrow

2001.6.30

转载请注明原文地址:https://www.9cbs.com/read-30206.html

New Post(0)