所以这就是我想要做的事情我试图将序列号复制到剪贴板但它不起作用如果是的话我做错了什么然后请帮助我我想让这个工作因为它对我的一个项目来说是我的我在卖
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include "windows.h"
namespace std {}
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
TCHAR volumeName[MAX_PATH + 1] = { 0 };
TCHAR fileSystemName[MAX_PATH + 1] = { 0 };
DWORD serialNumber = 0;
DWORD maxComponentLen = 0;
DWORD fileSystemFlags = 0;
if (GetVolumeInformation(
_T("C:\\"),
volumeName,
ARRAYSIZE(volumeName),
& serialNumber,
& maxComponentLen,
& fileSystemFlags,
fileSystemName,
ARRAYSIZE(fileSystemName)))
{
_tprintf(_T("Serial Number: %lu\n"), serialNumber);
GlobalUnlock(GetVolumeInformation);
OpenClipboard(NULL);
EmptyClipboard();
SetClipboardData(1, GetVolumeInformation);
CloseClipboard();
MessageBoxA(NULL, "HWID COPYED.", "HWID", NULL);
std::cout << std::endl << "Press any key to continue...";
getchar();
}
}