当前位置:网站首页>Imitate memz to make a special effect program
Imitate memz to make a special effect program
2022-07-21 22:08:00 【Ye Yixiao, who loves programming】
This program is based on MFC, The core code is annotated
// Special effect program 1Dlg.cpp : Implementation file
//
#include "stdafx.h"
#include " Special effect program 1.h"
#include " Special effect program 1Dlg.h"
#include "afxdialogex.h"
#include <Windows.h>
#include<Mmsystem.h>
#include <MMSystem.h>
#pragma comment (lib,"Winmm")
#pragma comment(lib,"winmm.lib")
#include <dwmapi.h>
#pragma comment (lib , "dwmapi.lib" )
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// C Special effect program 1Dlg Dialog box
C Special effect program 1Dlg::C Special effect program 1Dlg(CWnd* pParent /*=NULL*/)
: CDialogEx(IDD_MY1_DIALOG, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void C Special effect program 1Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(C Special effect program 1Dlg, CDialogEx)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_MFCBUTTON1, &C Special effect program 1Dlg::OnBnClickedMfcbutton1)
ON_WM_TIMER()
ON_BN_CLICKED(IDC_MFCBUTTON2, &C Special effect program 1Dlg::OnBnClickedMfcbutton2)
ON_WM_ERASEBKGND()
ON_WM_CLOSE()
END_MESSAGE_MAP()
// C Special effect program 1Dlg Message handler
BOOL C Special effect program 1Dlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Set the icon for this dialog . When the application's main window is not a dialog box , The frame will automatically
// Do this
SetIcon(m_hIcon, TRUE); // Set the big icon
SetIcon(m_hIcon, FALSE); // Set up small icons
char UserName[100];
unsigned long nSize = 100;
CString temp;
GetUserName(UserName, &nSize);
temp = UserName;
temp += ", Hello ";
GetDlgItem(IDC_STATIC1)->SetWindowTextA(temp);
char UserName1[100];
unsigned long nSize1 = 100;
CString temp1;
GetComputerName(UserName1, &nSize1);
temp1 = UserName1;
temp1 += " The computer , Hello ";
GetDlgItem(IDC_STATIC2)->SetWindowTextA(temp1);
char hostname[128];
//gethostname(hostname, 128);// Get the hostname
DWORD ser;
char filename[128];
::GetVolumeInformation("c:\\", hostname, 128, &ser, 0, 0, filename, 128);
CString DiskID;
DiskID.Format("%08X", ser);
CString temp2,temp3;
temp2 += " Disk serial number :";
temp2 += DiskID;
temp2 += "C disc , Hello ";
GetDlgItem(IDC_STATIC3)->SetWindowTextA(temp2);
temp3 = filename;
temp3 += " file system , Hello ";
GetDlgItem(IDC_STATIC4)->SetWindowTextA(temp3);
// TODO: Add additional initialization code here
return TRUE; // Unless you set the focus to the control , Otherwise return to TRUE
}
// If you add a minimize button to the dialog , You need the following code
// To draw the icon . For using documents / View model MFC Applications ,
// This will be done automatically by the framework .
void C Special effect program 1Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // Device context for drawing
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// Center the icon in the workspace 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 icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialogEx::OnPaint();
}
}
// When the user drags the minimized window, the system calls this function to get the cursor
// Show .
HCURSOR C Special effect program 1Dlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
POINT pt;
BOOL exitc = 0;
CDC *pDcc;
DWORD WINAPI ThreadProc(LPVOID a) {
POINT point1;
int i = 0, k = 1;
while (1>0)// Dead cycle
{
for (i = 0; i < 1000; i++)
{
if (exitc) {
GetCursorPos(&point1);
SetCursorPos(point1.x + rand() % k - rand() % k,
point1.y + rand() % k - rand() % k);// Move the mouse to the specified position on the screen
// Part of the code thanks Bili Bili braised
Sleep(10);
}
else {
return 0;
}
}
if (k < 50)
{
Sleep(10);
k++;
}
}
return 0;
}
void C Special effect program 1Dlg::OnBnClickedMfcbutton1()
{
GetDlgItem(IDC_MFCBUTTON1)->EnableWindow(FALSE);
GetDlgItem(IDC_MFCBUTTON2)->EnableWindow(TRUE);
CFile file(" No title .txt",CFile::modeCreate|CFile::modeWrite);// Open file
file.Write("YOUR COMPUTER HAS BEEN FUCKED BY THE MEMZ TROJAN.\r\nYour computer won't boot up again,\r\nso use it as long as you can!\r\n:D\r\nTrying to kill MEMZ will cause your system to\r\nbedestroyed instantly, so don t try it\r\n :D",strlen("YOUR COMPUTER HAS BEEN FUCKED BY THE MEMZ TROJAN.\r\nYour computer won't boot up again,\r\nso use it as long as you can!\r\n:D\r\nTrying to kill MEMZ will cause your system to\r\nbedestroyed instantly, so don t try it\r\n :D"));// write file
file.Close();// Close the file handle
ShellExecute(NULL,"open"," No title .txt",NULL,NULL,SW_SHOW);// Open with File Association
HWND hwnd = ::GetDesktopWindow(); // Get desktop handle
HDC hdc = ::GetWindowDC(hwnd); // Get the handle of the desktop context
BitBlt(hdc, 0, 0, GetSystemMetrics(SM_CXSCREEN),/* Get screen width */GetSystemMetrics(SM_CYSCREEN), hdc, 0, 0, DSTINVERT);
GetCursorPos(&pt);// Get mouse position
//DrawIcon(::GetDC(0), pt.x, pt.y, LoadIcon(0, IDI_WARNING));
DrawIcon(::GetDC(0), pt.x, pt.y, LoadIcon(0, IDI_ERROR));// draw icon
PlaySound(MAKEINTRESOURCE(IDR_WAVE1), AfxGetResourceHandle(), SND_ASYNC | SND_RESOURCE | SND_NODEFAULT | SND_LOOP);// The play
SetTimer(1, 500,NULL);// Here are the setting timers
SetTimer(2, 200, NULL);
SetTimer(3, 10000, NULL);
SetTimer(4, 50, NULL);
SetTimer(5, 7000, NULL);
SetTimer(6, 6000, NULL);
SetTimer(7, 700, NULL);
SetTimer(8, 5000, NULL);
SwapMouseButton(TRUE);
CreateThread(NULL, NULL, ThreadProc, NULL, 0, NULL);
exitc = 1;
// TODO: Add control notification handler code here
}
void C Special effect program 1Dlg::OnTimer(UINT_PTR nIDEvent)// Timer message handler
{
// TODO: Add message handler code and / Or call the default value
if (nIDEvent == 1) {
HWND hwnd = ::GetDesktopWindow(); // Get desktop handle
HDC hdc = ::GetWindowDC(hwnd); // Get the handle of the desktop context
BitBlt(hdc, 0, 0, GetSystemMetrics(SM_CXSCREEN),/* Get screen width */GetSystemMetrics(SM_CYSCREEN), hdc, 0, 0, DSTINVERT);// Reverse color
HWND hwnd10 = ::GetDesktopWindow(); // Get desktop handle
HDC hdc10 = ::GetWindowDC(hwnd10); // Get the handle of the desktop context
StretchBlt(hdc10, 0,
GetSystemMetrics(SM_CYSCREEN),/* Get screen width */
GetSystemMetrics(SM_CXSCREEN),/* Get screen height */
-GetSystemMetrics(SM_CYSCREEN),/* Inverted screen */
hdc10, 0, 0,
GetSystemMetrics(SM_CXSCREEN), /* Get screen width */
GetSystemMetrics(SM_CYSCREEN), /* Get screen height */
SRCAND/* By using AND( And ) Operator to merge the colors in the source and target rectangular areas .*/);
}
//POINT pt;
else {
if (nIDEvent == 2)
{
GetCursorPos(&pt);// Get mouse position
//DrawIcon(::GetDC(0), pt.x, pt.y, LoadIcon(0, IDI_WARNING));
DrawIcon(::GetDC(0)/* obtain DC*/, pt.x, pt.y, LoadIcon(0, IDI_ERROR));// draw icon
}
else {
if (nIDEvent == 3)
{
ShellExecute(0, NULL, "http://www.google.com/", NULL, NULL, SW_SHOW/*NORMAL*/);// Open an inaccessible web page
}
else {
/*CBitmap bitmap;
bitmap.LoadBitmapA(IDB_BITMAP1);*/
//CDC dc;
/*HWND hwnd = ::GetDesktopWindow(); // Get desktop handle
HDC hdc = ::GetWindowDC(hwnd); // Get the handle of the desktop context
BitBlt(hdc, 0, 0,GetSystemMetrics(SM_CXSCREEN),/* Get screen width *\/*//*GetSystemMetrics(SM_CYSCREEN),/* Get screen height *\/hdc, 0, 0, SRCCOPY);*/
//Sleep(500); // wait for 500 millisecond ( That is to say 0.5 second )
//
//dc.CreateCompatibleDC(pDcc);
//dc.SelectObject(&bitmap);
//CRect rect;
//GetClientRect(&rect);
//pDcc->BitBlt(0, 0, rect.Width(), rect.Height(), &dc, 0, 0, SRCCOPY);
/*CPoint pos1;
pos1.x = 0;
pos1.y = 5000;
CBrush brush(RGB(255, 0, 0));
CClientDC dc(this);
//CWindowDC dc(GetDesktopWindow());
dc.FillRect(dc.CRect(pos1.x,pos1.y), &brush);*/
//YOUR COMPUTER HaS BEEH FUCKED BY THE MEM2 TROJAN.
//Your conputer uon't boot up again,\ns0 use it as 1ong as you cant\n : D\n Irying to kill HENR ui11 cause your systen to be\n destroyed instantly, s0 don't try it :D
if (nIDEvent == 4) {
HWND hWnd1 = ::FindWindow(NULL, " Task manager ");
HWND hWnd2 = ::FindWindow(NULL, "Windows Task manager ");// Get the task manager window handle
//MessageBox(" Getting window handle ");
//if (hWnd != NULL)
//{
::PostMessage(hWnd1, WM_DESTROY, NULL, NULL);
//}
//if (hWnd1 != NULL) {
::PostMessage(hWnd2, WM_DESTROY, NULL, NULL);// Send a close message to the task manager
}
else {
if (nIDEvent == 5) {
HWND hwnd3 = ::GetDesktopWindow(); // Get desktop handle
HDC hdc1 = ::GetWindowDC(hwnd3); // Get the handle of the desktop context
BitBlt(hdc1, 0, 0, GetSystemMetrics(SM_CXSCREEN),/* Get screen width */GetSystemMetrics(SM_CYSCREEN), hdc1, 0, 0, BLACKNESS);
//Sleep(1000);
::PostMessage(hwnd3, WM_PAINT, NULL, NULL);
::PostMessage(hwnd3, WM_NCPAINT, NULL, NULL);
}
else {
if (nIDEvent == 6) {
HWND hwnd4 = ::GetDesktopWindow(); // Get desktop handle
HDC hdc2 = ::GetWindowDC(hwnd4); // Get the handle of the desktop context
BitBlt(hdc2, 0, 0, GetSystemMetrics(SM_CXSCREEN),/* Get screen width */GetSystemMetrics(SM_CYSCREEN), hdc2, 0, 0, WHITENESS);
}
//Sleep(1000);
//::PostMessage(hwnd4, WM_PAINT, NULL, NULL);
//::PostMessage(hwnd4, WM_NCPAINT, NULL, NULL);
if (nIDEvent == 7) {
HWND hwnd11 = ::GetDesktopWindow(); // Get desktop handle
HDC hdc11 = ::GetWindowDC(hwnd11); // Get the handle of the desktop context
StretchBlt(hdc11, 0, 30,
GetSystemMetrics(SM_CXSCREEN) - 100,/* Target width */
GetSystemMetrics(SM_CYSCREEN) - 80,/* Target height */
hdc11, 0, 0,
GetSystemMetrics(SM_CXSCREEN), /* Get screen height */
GetSystemMetrics(SM_CYSCREEN), /* Get screen width **/
SRCCOPY/* Copy the source rectangle directly to the destination rectangle .*/
);
}
if (nIDEvent == 8) {
mciSendString("set cdaudio door open", NULL, NULL, NULL);
}
}
}
//MessageBox(" Sending closing message ");
//}
}
}
//Your computer is not MEMZ occupation, you can restart your computer, do not need to cherish the use, you can try to end the process.
}
}
//DrawIcon(::GetDC(0), pt.x, pt.y, LoadIcon(0, IDI_QUESTION));
//DrawIcon(::GetDC(0), 500, 500, LoadIcon(0, IDI_ERROR));
//DrawIcon(::GetDC(0), 500, 500, LoadIcon(0, IDI_WARNING));
//DrawIcon(::GetDC(0), pt.x, pt.y, LoadIcon(0, IDI_QUESTION));
//CDialogEx::OnTimer(nIDEvent);
//}
void C Special effect program 1Dlg::OnBnClickedMfcbutton2()//" stop it " Button's message response function
{
GetDlgItem(IDC_MFCBUTTON1)->EnableWindow(TRUE);
//GetDlgItem(IDC_MFCBUTTON2)->EnableWindow(TRUE);
KillTimer(1);// Here are cancel timers
KillTimer(2);
KillTimer(3);
KillTimer(4);
KillTimer(5);
KillTimer(6);
KillTimer(7);
KillTimer(8);
PlaySound(NULL, NULL, SND_PURGE);// Stop playing the sound
SwapMouseButton(FALSE);
exitc = 0;
//DeleteFile(" No title .txt");
// TODO: Add control notification handler code here
}
BOOL C Special effect program 1Dlg::OnEraseBkgnd(CDC* pDC)// Obsolete erase background handler
{
// TODO: Add message handler code and / Or call the default value
/*pDcc = pDC;
CBitmap bitmap;
bitmap.LoadBitmapA(IDB_BITMAP1);
CDC dc;
dc.CreateCompatibleDC(pDcc);
dc.SelectObject(&bitmap);
CRect rect;
GetClientRect(&rect);
pDcc->BitBlt(0, 0, rect.Width(), rect.Height(), &dc, 0, 0, SRCCOPY);
*/
return CDialogEx::OnEraseBkgnd(pDC)/*TRUE*/;
}
void C Special effect program 1Dlg::OnClose()
{
// TODO: Add message handler code and / Or call the default value
GetDlgItem(IDC_MFCBUTTON1)->EnableWindow(TRUE);
GetDlgItem(IDC_MFCBUTTON2)->EnableWindow(TRUE);
KillTimer(1);// Here are cancel timers
KillTimer(2);
KillTimer(3);
KillTimer(4);
KillTimer(5);
KillTimer(6);
KillTimer(7);
PlaySound(NULL, NULL, SND_PURGE);// Stop playing the sound
SwapMouseButton(FALSE);
CDialogEx::OnClose();
}
Simple code , You should understand
边栏推荐
- "In 0202, there are still people learning NFC!?"
- TS 类 和 ES6 类对比
- 《关于 SylixOS 内核存在的问题 - CAN 内核驱动》
- 学习 LwIP 期间解决的网络 bug
- Raspberry pie 4B new machine system configuration and computer connection operation
- 内置平头哥玄铁的WiFi和蓝牙芯片
- 专题解答:nmn概念股是什么意思,NMN到底是什么
- Acmix: the fusion of convolution and self attention
- 【半导体先进工艺制程技术系列】HKMG工艺技术(下)
- liteos连接器脚本(二)
猜你喜欢
Armv8 cortex-a programming wizard manual learning_ five
PCB电路板和集成电路的特点与区别
【半导体先进工艺制程技术系列】SOI技术(下)
参与开源社区还有证书拿?
Raspberry pie 4B switch system and PIP image source
Realtek USB wireless network card can find WiFi and cannot connect to the network
如何写好技术安全需求TSR?
Missing sigset at compile time h xlocal. h huge_ Val.h and other solutions
Armv8 cortex-a programming wizard manual learning_ three
ARMv8 Cortex-a 编程向导手册学习_1
随机推荐
全面:Realtek/瑞昱无线产品图谱及市场构成
Missing sigset at compile time h xlocal. h huge_ Val.h and other solutions
华为liteos内存管理源码以及架构分析
001_ SSSSS_ Denoising Diffusion Probabilistic Models
海外LPWAN的王者是我,一文看懂Wi-Sun协议
Blender recipes for building an open domain Chatbot
这家蓝牙芯片巨头瞄准了WiFi SOC市场,重磅发布低功耗WiFi MCU产品线
The library file written by yourself reports an error in vs Code: undefined reference to 'xxx'
《关于 SylixOS 内核存在的问题 - CAN 内核驱动》
专题解答:nmn概念股是什么意思,NMN到底是什么
物联网由哪些部分组成?
Raspberry pie 4B sound sensor Ao module
Li Mu's learning notes of hands-on learning in depth (3) Chapter 1 preparatory knowledge section 1 data operation
Task oriented dialogue system for automatic disease diagnosis via HRL based on hierarchical reinforcement learning
Armv8 cortex-a programming wizard manual learning_ four
G了,眼看就过年了,突然被领导安排了个新任务
Armv8 cortex-a programming wizard manual learning_ two
Arm V7 kernel notes - General timers and related coprocessors
头部标题小竖线制作/LOGO SEO优化
【半导体先进工艺制程技术系列】SOI技术(下)