📄 test1view.cpp
字号:
strcpy(ProcessRule.rule,"PROTECT");
ProcessRule._next = NULL;
ret = HkApi_AddProcessRule(ProcessRule);
if( ret == 0)
{
tmp_strText1 = "策略添加成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略添加失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelprocess1()
{
m_strText.Empty();
Test_DelProcess1();
m_rich.SetWindowText(m_strText);
// TODO: Add your command handler code here
}
int Ctest1View::Test_DelProcess1(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除策略:\n";
PROCESSHIDERULE ProcessRule;
strcpy(ProcessRule.rule,"CLIENTDEMO");
ProcessRule._next = NULL;
ret = HkApi_DelProcessRule(ProcessRule);
if( ret == 0)
{
tmp_strText1 = "策略删除成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略删除失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelprocess2()
{
m_strText.Empty();
Test_DelProcess2();
m_rich.SetWindowText(m_strText);
// TODO: Add your command handler code here
}
int Ctest1View::Test_DelProcess2(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除策略:\n";
PROCESSHIDERULE ProcessRule;
strcpy(ProcessRule.rule,"PROTECT");
ProcessRule._next = NULL;
ret = HkApi_DelProcessRule(ProcessRule);
if( ret == 0)
{
tmp_strText1 = "策略删除成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略删除失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelprocessall()
{
m_strText.Empty();
Test_DelProcessAll();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DelProcessAll(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除全部策略:\n";
ret = HkApi_ClearAllProcessRule();
if( ret == 0)
{
tmp_strText1 = "删除全部策略成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "删除全部策略失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
////////////////////////注册表项部分//////////////////////////////////
void Ctest1View::OnAddkey1()
{
m_strText.Empty();
Test_AddKey1();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_AddKey1(void)
{
int ret;
CString tmp_strText1;
m_strText="开始添加策略:\n";
KEYHIDERULE KeyRule;
strcpy(KeyRule.rule,"HidServ");
KeyRule._next = NULL;
ret = HkApi_AddKeyRule(KeyRule);
if( ret == 0)
{
tmp_strText1 = "策略添加成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略添加失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnAddkey2()
{
m_strText.Empty();
Test_AddKey2();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_AddKey2(void)
{
int ret;
CString tmp_strText1;
m_strText="开始添加策略:\n";
KEYHIDERULE KeyRule;
strcpy(KeyRule.rule,"Cyber02Hide");
KeyRule._next = NULL;
ret = HkApi_AddKeyRule(KeyRule);
if( ret == 0)
{
tmp_strText1 = "策略添加成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略添加失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelkey1()
{
m_strText.Empty();
Test_DelKey1();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DelKey1(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除策略:\n";
KEYHIDERULE KeyRule;
strcpy(KeyRule.rule,"HidServ");
KeyRule._next = NULL;
ret = HkApi_DelKeyRule(KeyRule);
if( ret == 0)
{
tmp_strText1 = "策略删除成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略删除失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelkey2()
{
m_strText.Empty();
Test_DelKey2();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DelKey2(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除策略:\n";
KEYHIDERULE KeyRule;
strcpy(KeyRule.rule,"Cyber02Hide");
KeyRule._next = NULL;
ret = HkApi_DelKeyRule(KeyRule);
if( ret == 0)
{
tmp_strText1 = "策略删除成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略删除失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelallkey()
{
// TODO: Add your command handler code here
m_strText.Empty();
Test_DeKeyAll();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DeKeyAll(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除全部策略:\n";
ret = HkApi_ClearAllKeyRule();
if( ret == 0)
{
tmp_strText1 = "删除全部策略成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "删除全部策略失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
////////////////////////注册表键值部分//////////////////////////////////
void Ctest1View::OnAddvalue1()
{
m_strText.Empty();
Test_AddValue1();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_AddValue1(void)
{
int ret;
CString tmp_strText1;
m_strText="开始添加策略:\n";
VALUEHIDERULE ValueRule;
strcpy(ValueRule.rule,"DisplayName");
ValueRule._next = NULL;
ret = HkApi_AddValueRule(ValueRule);
if( ret == 0)
{
tmp_strText1 = "策略添加成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略添加失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnAddvalue2()
{
m_strText.Empty();
Test_AddValue2();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_AddValue2(void)
{
int ret;
CString tmp_strText1;
m_strText="开始添加策略:\n";
VALUEHIDERULE ValueRule;
strcpy(ValueRule.rule,"ImagePath");
ValueRule._next = NULL;
ret = HkApi_AddValueRule(ValueRule);
if( ret == 0)
{
tmp_strText1 = "策略添加成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略添加失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelvalue1()
{
m_strText.Empty();
Test_DelValue1();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DelValue1(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除策略:\n";
VALUEHIDERULE ValueRule;
strcpy(ValueRule.rule,"DisplayName");
ValueRule._next = NULL;
ret = HkApi_DelValueRule(ValueRule);
if( ret == 0)
{
tmp_strText1 = "策略删除成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略删除失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelvalue2()
{
m_strText.Empty();
Test_DelValue2();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DelValue2(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除策略:\n";
VALUEHIDERULE ValueRule;
strcpy(ValueRule.rule,"ImagePath");
ValueRule._next = NULL;
ret = HkApi_DelValueRule(ValueRule);
if( ret == 0)
{
tmp_strText1 = "策略删除成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "策略删除失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
void Ctest1View::OnDelvalueall()
{
m_strText.Empty();
Test_DelValueAll();
m_rich.SetWindowText(m_strText);
}
int Ctest1View::Test_DelValueAll(void)
{
int ret;
CString tmp_strText1;
m_strText="开始删除全部策略:\n";
ret = HkApi_ClearAllValueRule();
if( ret == 0)
{
tmp_strText1 = "删除全部策略成功\n\n";
m_strText+=tmp_strText1;
}
else
{
tmp_strText1 = "删除全部策略失败\n\n";
m_strText+=tmp_strText1;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -