Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
if(hwnd==gesuchtesFensterhandle)
{
call_funktion(hwnd);
return FALSE;
}
else
return TRUE;
}
int main(void)
{
EnumThreadWindows(ThreadId, (WNDENUMPROC)EnumWindowsProc, NULL);
[...]
}
if(hwnd==gesuchtesFensterhandle)
Und woher soll ich bitte wissen, welches Fenster du suchst, irgendwelche konkreten Eigenschaften sollte das schon aufweisen, ansonsten findet man es nicht, von daher kannste den Vergleich durch einen beliebigen von dir ersetzen.
unsigned long getpid(char *procname)
{
HANDLE handle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 procinfo = { sizeof(PROCESSENTRY32) };
while(Process32Next(handle, &procinfo))
{
if(!strcmp(procinfo.szExeFile, procname))
{
CloseHandle(handle);
return procinfo.th32ProcessID;
}
}
CloseHandle(handle);
return 0;
}