设为首页 加入收藏

TOP

VC++另类实现进程插入(二)
2014-11-23 19:30:42 】 浏览:432
Tags:另类 实现 进程 插入
extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}

void CWaiGuaTestDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CWaiGuaTestDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, ( WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CWaiGuaTestDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

void CWaiGuaTestDlg::OnBUTGetProc()
{
// TODO: Add your control notification handler code here
((CComboBox *)GetDlgItem(IDC_COM_Proc))->ResetContent();

for(int i=0 ; i < 100 ; i++)
szThreadId[i] = 0;

HANDLE hSnapShot;
PROCESSENTRY32 szEntry;

szEntry.dwSize = sizeof(PROCESSENTRY32);

hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS , 0);

if(hSnapShot == INVALID_HANDLE_VALUE)
{
MessageBox("CreateToolhelp32Snapshot Error!");
return;
}

if(Process32First(hSnapShot,&szEntry))
{
int i=1;
((CComboBox *)GetDlgItem(IDC_COM_Proc))->AddString(szEntry.szExeFile);

szThreadId[0] = szEntry.th32ProcessID;

while(Process32Next(hSnapShot,&szEntry))
{
((CComboBox *)GetDlgItem(IDC_COM_Proc))->AddString(szEntry.szExeFile);
szThreadId[i] = szEntry.th32ProcessID;
i++;
}

MessageBox("获取 系统进程列表成功");
((CComboBox *)GetDlgItem(IDC_COM_Proc))->SetCurSel(i-1);

return;
}
}

void CWaiGuaTestDlg::OnButExecution()
{
// TODO: Add your control notification handler code here

//*******跳过远程线程代码,执行本程序*******
goto REMOTE_THREAD_END;


//////////////////////////////////////////////////////////////////////////
//////*******远程线程代码*******
//////////////////////////////////////////////////////////////////////////
REMOTE_THREAD_BEGIN:

_asm
{
//*******给LoadLibrary函数地址占位*******
LoadLibraryAddr:
nop
nop
nop
nop
//*******给FreeLibrary函数地址占位*******
FreeLibraryAddr:
nop
nop
nop
nop
//*******给动态链接库名占位*******
Lib
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇VC++创建指定路径的一系列文件夹 下一篇vc 下拉列表框 编程

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目