Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
#include <windows.h>
#include <tlhelp32.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
typedef BOOL (WINAPI *TH32_PROCESS)
(HANDLE hSnapShot, LPPROCESSENTRY32 lppe);
static TH32_PROCESS pProcess32First = NULL;
static TH32_PROCESS pProcess32Next = NULL;
int main()
{
PROCESSENTRY32 pe32 = { 0 };
HANDLE hSnapshot = NULL;
HINSTANCE hDll = LoadLibrary("kernel32.dll");
pProcess32First=(TH32_PROCESS)GetProcAddress(hDll,"Process32First");
pProcess32Next=(TH32_PROCESS)GetProcAddress(hDll,"Process32Next");
hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if (hSnapshot != (HANDLE) -1)
{
pe32.dwSize = sizeof (PROCESSENTRY32);
int proc_cnt=0,thrd_cnt=0;
if (pProcess32First (hSnapshot, &pe32))
{
ofstream outfile("C:\\prozesse.txt");
ostringstream outf;
string outfi;
do
{
outf << pe32.szExeFile;
outf << "\n";
} while(pProcess32Next (hSnapshot, &pe32));
outfi = outf.str();
cout << outfi << endl;
outfile << outfi;
outfile.close();
}
CloseHandle (hSnapshot);
}
cin.get();
return 0;
}