123.cpp

来自「用VC语言编写木马软件源程序」· C++ 代码 · 共 66 行

CPP
66
字号
#include<windows.h>//引入必要的头文件


int WINAPI WinMain(
  HINSTANCE hInstance,  // handle to current instance
  HINSTANCE hPrevInstance,  // handle to previous instance
  LPSTR lpCmdLine,      // pointer to command line
  int nCmdShow          // show state of window
)
{
	//代码写在这里
	if(FindWindow("TForm1","传奇世界客户端")!=0)
	{
		MessageBox(NULL,TEXT("传奇世界已经运行"),"对话框窗口的标题",MB_OK);
	}
	else
	{
		MessageBox(NULL,TEXT("传奇世界没有运行"),"对话框窗口的标题",MB_OK);
	}
	return 0;
}














/*
现在开始写程序
Windows程序一般都是由WinMain函数做为程序入口 就像C语言里的main一样
看看WinMain的原型吧  如下
int WINAPI WinMain(
  HINSTANCE hInstance,  // handle to current instance
  HINSTANCE hPrevInstance,  // handle to previous instance
  LPSTR lpCmdLine,      // pointer to command line
  int nCmdShow          // show state of window
);



  FindWindow()是一个API函数   看一下原型  如下
  HWND FindWindow(
  LPCTSTR lpClassName,  // 窗口类名
  LPCTSTR lpWindowName  // 窗口标题
);



  MessageBox也是一个API函数
  int MessageBox(
  HWND hWnd,          // handle of owner window
  LPCTSTR lpText,     // address of text in message box
  LPCTSTR lpCaption,  // address of title of message box
  UINT uType          // style of message box
);

*/

⌨️ 快捷键说明

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