Click here to Skip to main content
15,886,067 members
Articles / Desktop Programming / MFC

Process viewer

Rate me:
Please Sign up or sign in to vote.
4.94/5 (104 votes)
9 Mar 2008CPOL9 min read 455.4K   22K   294  
Lists out the details of running processes in a system, loaded drivers, loaded dlls, version of each dll and process, process times, command line, owner, priority, GDI resource usage, privileges, loaded symbols, window heirarchy, autostart app finding and more.
/**
 * Copyright(c) 2007 Nibu babu thomas
 *
 * DeferWindowPosMgr.h - Contains interface declaration for DeferWindowPosMgr class.
 *
 * @author :    Nibu babu thomas
 * @version:    1.0            Date:  2007-04-08
 */


#ifndef _DEFER_WINDOW_POS_MGR_H_
#define _DEFER_WINDOW_POS_MGR_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


/**
 * Copyright(c) 2007 Nibu babu thomas
 *
 * DeferWindowPosMgr - Class that manages defer window position API functions.
 *
 * @author :    Nibu babu thomas
 * @version:    1.0            Date:  2007-04-08
 */
class DeferWindowPosMgr  
{
    public:

        DeferWindowPosMgr( const bool bRepaintOnDeferPos_i = false, const bool bEnableSetRedraw_i = false, HWND hWindow_i = 0 );

        // Destructor
	    virtual ~DeferWindowPosMgr();

        // Attaches a defer pos structure. Structure won't be attached if
        // we already have another valid hdwp on our hand
        bool AttachHDWP( HDWP& hDeferPosStruct_i );

        // Set repaint status flag
        void SetRepaintOnDeferPos( const bool bRepaintOnDeferPos_i );
        bool IsRepaintOnDeferPosEnabled();

        // Enables/Disables SetRedraw 
        void SetRedrawEnabled( const bool bRedrawEnabled_i, HWND& hWindow_i );
        bool IsRedrawEnabled();

        // Helper for BeginDeferWindowPos
        bool Begin( const int nWindowCount_i );
        bool End();

        // Add a window to only size, no move
        bool AddSizeWindow( CWnd& wndToSize_i, 
                            const SIZE& sizNewSize_i,
                            HWND pwndInsertAfter_i = 0,
                            UINT uPosFlags_i = SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED );

        // Add a window to only move, no size
        bool AddRepositionWindow( CWnd& wndToReposition_i, 
                                  const POINT& ptNewPosition_i, 
                                  HWND pwndInsertAfter_i = 0,
                                  UINT uPosFlags_i = SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );

        // Add a window to both move and size
        bool AddMoveWindow( CWnd& wndToMove_i, 
                            const RECT& rcNewCoords_i, 
                            HWND pwndInsertAfter_i = 0,
                            UINT uPosFlags_i = SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED );

    private:

        HDWP m_hdwp;

        bool m_bRepaintOnDeferPos;

        bool m_bSetRedrawEnabled;
        HWND m_hRedrawWindow;

};// End DeferWindowPosMgr

#endif // _DEFER_WINDOW_POS_MGR_H_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions