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.
SetConsoleTitle("MeinProgramm");
HWND hMeinFenster = FindWindow(NULL, "MeinProgramm");
ShowWindow(hFenster, SW_HIDE);
#include <windows.h>
void Icon_in_Taskleiste (HWND hwnd, BOOL bAnzeigen)
{
NOTIFYICONDATA tsym;
ZeroMemory (&tsym, sizeof (NOTIFYICONDATA));
if (bAnzeigen)
{
tsym.cbSize = sizeof (NOTIFYICONDATA);
tsym.hWnd = hwnd;
tsym.uID = 1;
tsym.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;
tsym.uCallbackMessage = WM_APP;
//tsym.hIcon = hIcon;
strcpy (tsym.szTip, "Mein Programm...");
Shell_NotifyIcon (NIM_ADD, &tsym);
}
else
{
tsym.cbSize = sizeof (NOTIFYICONDATA);
tsym.hWnd = hwnd;
tsym.uID = 1;
tsym.uFlags = 0;
Shell_NotifyIcon (NIM_DELETE, &tsym);
}
return;
}
int main()
{
SetConsoleTitle("MeinProgramm");
HWND hMeinFenster = FindWindow(NULL, "MeinProgramm");
Icon_in_Taskleiste(hMeinFenster, 1);
ShowWindow(hMeinFenster, SW_HIDE);
return 0;
}
moin
MFC brauchst du nicht, sondern nur ein Handle des eigenen Fensters und dann kanns losgehen, also:
Wenn du den Code einbaust kommst du nur noch per TaskManager ran!Code:SetConsoleTitle("MeinProgramm"); HWND hMeinFenster = FindWindow(NULL, "MeinProgramm"); ShowWindow(hFenster, SW_HIDE);
mfg
umbrasaxum
||=== Build: Release in boot (compiler: GNU GCC Compiler) ===|
C:\Users\Marcel\Desktop\AdSoleWare Development\AdSoleWare Application\adsoleware\boot\main.cpp||In function 'int main()':|
C:\Users\Marcel\Desktop\AdSoleWare Development\AdSoleWare Application\adsoleware\boot\main.cpp|21|error: 'hFenster' was not declared in this scope|
C:\Users\Marcel\Desktop\AdSoleWare Development\AdSoleWare Application\adsoleware\boot\main.cpp|19|warning: unused variable 'hMeinFenster' [-Wunused-variable]|
||=== Build failed: 1 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|
Ehm... Hallo erstmals.... Ich hab das Problem das dies bei mir nicht funktioniert :/....
Das wären die Fehlermeldungen:
Code:||=== Build: Release in boot (compiler: GNU GCC Compiler) ===| C:\Users\Marcel\Desktop\AdSoleWare Development\AdSoleWare Application\adsoleware\boot\main.cpp||In function 'int main()':| C:\Users\Marcel\Desktop\AdSoleWare Development\AdSoleWare Application\adsoleware\boot\main.cpp|21|error: 'hFenster' was not declared in this scope| C:\Users\Marcel\Desktop\AdSoleWare Development\AdSoleWare Application\adsoleware\boot\main.cpp|19|warning: unused variable 'hMeinFenster' [-Wunused-variable]| ||=== Build failed: 1 error(s), 1 warning(s) (0 minute(s), 0 second(s)) ===|