Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Query the New Windows Audit Policies Programmatically

, 26 Feb 2010 CPOL
This sample show how to access the information retrieved by running Auditpol.
// Audit Policy BrowserDlg.h : header file
#pragma once
#include "afxwin.h"
#include "afxcmn.h"

//	Forwarded reference
class CAuditPolicyManager;

// CAuditPolicyBrowserDlg dialog
class CAuditPolicyBrowserDlg : public CDialog
	// Construction
	CAuditPolicyBrowserDlg(CWnd* pParent = NULL);

	// Dialog Data

	virtual void DoDataExchange(CDataExchange*);

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBnClickedButtonEnumerateCategories();
	afx_msg void OnCategoriesKeyDown(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnCategoryChanged();
	afx_msg void OnSubcategorySelection();

	void ShowSubCategories(const CString& category);
	CAuditPolicyManager m_auditPolicyManager;

	//	UI
	HICON m_hIcon;
	CListBox m_listBoxCategories;
	CListBox m_listBoxSubcategories;
	CStatic m_staticAuditPolicyNone;
	CStatic m_staticAuditPolicySuccess;
	CStatic m_staticAuditPolicyFailure;

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.


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


About the Author

marc ochsenmeier
Software Developer (Senior) winitor
Germany Germany
Marc Ochsenmeier is the author of PEStudio ( and works as developer with the focus on Windows Hardening.
PEStudio is on twitter at:

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150326.1 | Last Updated 26 Feb 2010
Article Copyright 2010 by marc ochsenmeier
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid