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

📄 noprev.cpp

📁 <Win2k系统编程>源码.次数为国人自编,内容丰富,还是不错的.
💻 CPP
字号:
// NoPrev.cpp : Defines the entry point for the application.
//

#include "stdafx.h"

#define VK_X 0x58

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.
	HANDLE h = CreateMutex(NULL,TRUE,"No Previous Instance!");
	if (!h)
	{
		MessageBox(NULL,"Fail to create Mutex !","NoPrev",
			MB_OK|MB_SYSTEMMODAL);
		return FALSE;
	}

	if (GetLastError()==ERROR_ALREADY_EXISTS)
	{
		MessageBox(NULL,
		"Previous Instance is running, the current is forbidden!",
		"NoPrev",MB_OK|MB_SYSTEMMODAL);
		return FALSE;
	}

	if (!RegisterHotKey(NULL,0x0001,
		MOD_CONTROL|MOD_SHIFT,VK_X))
	{
		MessageBox(NULL,"Fail to register hotkey Ctrl+Shift+X!",
			"NoPrev",MB_OK|MB_SYSTEMMODAL);
		return FALSE;	
	}

	MessageBox(NULL,
	"NoPrev is running!\n\nHotkey Ctrl+Shift+X will stop NoPrev.",
	"NoPrev",MB_OK|MB_SYSTEMMODAL);

	MSG msg;
	while(GetMessage(&msg,NULL,0,0))
	{
		switch(msg.message)
		{
		case WM_HOTKEY:
			if (int(msg.wParam)==0x0001)
				if(MessageBox(NULL,"Stop NoPrev?","NoPrev",
					MB_OK|MB_SYSTEMMODAL)==IDYES)
					return FALSE;
		}
	}

	//CloseHandle(h); 
	return TRUE;
}

⌨️ 快捷键说明

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