⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userlist.cpp

📁 在驱动下实现进程隐藏,在驱动下实现进程隐藏.
💻 CPP
字号:
// UserList.cpp : implementation file
//

#include "stdafx.h"
#include "GUI.h"
#include "UserList.h"
#include ".\userlist.h"
#include "UserWork.h"
// UserList dialog



IMPLEMENT_DYNAMIC(UserList, CDialog)
UserList::UserList(CWnd* pParent /*=NULL*/)
	: CDialog(UserList::IDD, pParent)
{
}

UserList::~UserList()
{
}

void UserList::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST_USERS, mListUsers);
}


BEGIN_MESSAGE_MAP(UserList, CDialog)
	ON_BN_CLICKED(IDC_BUTTON_OK, OnBnClickedButtonOk)
	ON_BN_CLICKED(IDC_BUTTON_CANCEL, OnBnClickedButtonCancel)
END_MESSAGE_MAP()


BOOL UserList::OnInitDialog()
{
	CDialog::OnInitDialog();
	SetWindowText(_T("Local Users"));

	mListUsers.InsertColumn(0,_T("Name"),LVCFMT_LEFT,130,0);
	mListUsers.InsertColumn(1,_T("SID"),LVCFMT_LEFT,280,1);
	DWORD dwExStyle_f=mListUsers.GetExtendedStyle();
	dwExStyle_f= (LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
	mListUsers.SetExtendedStyle(dwExStyle_f);

	GetUsers();

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void UserList::GetUsers()
{
	CString str;
	int nIndex = mListUsers.GetItemCount();

	UserSidStorage UserNames;
	GetUserNames(UserNames);
	UserSidStorage::iterator it = UserNames.begin();
	for(;UserNames.end()!=it;++it)
	{
		// User Name
		str.Format(_T("%ws"),(*it).first.data());
		mListUsers.InsertItem(nIndex,str);
		// User SID
		str.Format(_T("%ws"),(*it).second.data());
		mListUsers.SetItemText(nIndex,1,str);

		++nIndex;
	}
}
void UserList::OnBnClickedButtonOk()
{
	strUsers.clear();
	POSITION pos = mListUsers.GetFirstSelectedItemPosition();
	if (pos == NULL)
	{
		CDialog::OnOK();
		return;
	}

	while (pos)
	{
		int nItem = mListUsers.GetNextSelectedItem(pos);
		CString UserSID = mListUsers.GetItemText(nItem,0);

		PWCHAR str = (PWCHAR)UserSID.GetString();

		if(!strUsers.empty())
			strUsers+=L',';

		strUsers+=str;
	}
	
	CDialog::OnOK();
}

void UserList::OnBnClickedButtonCancel()
{
	CDialog::OnCancel();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -