none
How to place a window behind the desktop icons RRS feed

  • 问题

  •  

    Hi, everybody. How to place a window behind the desktop icons ? like the
    images I attatched.

    The code like this :

    HWND g_hwnd = NULL;
    CWndDummy m_wndDummy;


    // DLL Entry Point
    extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID
    lpReserved)
    {
        HWND hwnd = FindWindow( _T("Progman"), NULL );
        if( hwnd ) hwnd = FindWindowEx( hwnd, NULL, _T("SHELLDLL_DefView"),
    NULL );
        // if( hwnd ) hwnd = FindWindowEx( hwnd, NULL, _T("SysListView32"),
    NULL );
        if( hwnd ) {
            g_hwnd = hwnd;
        }

        if (dwReason==DLL_PROCESS_ATTACH)
        {
            if (g_hwnd)
            {
                m_wndDummy.Create(g_hwnd);
                if (m_wndDummy.IsWindow())
                {
                    m_wndDummy.ShowWindow(SW_NORMAL);
                    m_wndDummy.UpdateWindow();
                    m_wndDummy.MoveWindow(0, 0, 600, 500);
                }
            }
        }
        else if (dwReason == DLL_PROCESS_DETACH)
        {
            if (m_wndDummy.IsWindow())
            {
                m_wndDummy.DestroyWindow();
                m_wndDummy.m_hWnd = NULL;
            }
        }

        hInstance;
        return _AtlModule.DllMain(dwReason, lpReserved);
    }


    I doing it like this: compiling the .rar project, and registered it.
    Now I open a explorer window. then I right clicked desktop, then menu ->
    "properties" -> "display properties" dialog -> "desktop" -> "customics
    desktop" button -> "desktop items" dialog -> "Web" -> check the "current
    homepage" checkbox , then OK, OK, OK.
    Now my dialog appears.

    I know this is a bad way, can anybody tell me a better way?

    2008年12月29日 4:32

答案

全部回复