Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

ich habe da mal problem. in einem meiner programme erstelle ich ein menü. dieses menü wird beim drücken auf ein icon in der notifycation area sichtbar. hier der code dazu.


// ...

LRESULT CALLBACK LRESULT CALLBACK WndProc (...);


// Globale - Variablen

   HWND hWnd;

   HMENU hMenu;


int WINAPI WinMain (...)

{

   // Fenster erstellen

   // hWnd = Neues Fenster 


   // Menü erstellen

   hMenu = CreatePopupMenu();


   // Setze Menü- Informationen

   mi.cbSize = sizeof(MENUINFO);

   mi.fMask = MIM_STYLE;

   mi.dwStyle = MNS_AUTODISMISS | MNS_NOCHECK;

   SetMenuInfo (hMenu, &mi);


   // Füge Menueinträge ein

   mii.dwTypeData = "Menüpunkt 1";

   mii.cch = sizeof ("Menüpunkt 1");

   mii.wID = IDM_MENU1;

   InsertMenuItem (hMenu, 0, TRUE, &mii);

   mii.dwTypeData = "Menüpunkt 2";

   mii.cch = sizeof ("Menüpunkt 2");

   mii.wID = IDM_MENU2;


   // Icon anzeigen (Shell_NotifyIcon)


   // ...

}


LRESULT CALLBACK LRESULT CALLBACK WndProc (...)

{

   switch (uMsg)

   {

   case WM_TRAYMESSAGE:  // Traynachrichten behandeln

      switch (lParam)

      {

         case WM_LBUTTONDOWN:

            TrackPopupMenu (hMenu, TPM_LEFTALIGN, 200, 200, 0, hWnd, NULL);

            break;

      }

      break;

   case WM_COMMAND:      // Menüauswahl behandeln

      switch (wParam)

      {

         case IDM_MENU1:

            break;

         case IDM_MENU2:

            break;

      }

   // ...

   }

   return DefWindowProc (...);

}

Dazu gibt es jetzt zwei Fragen.

Die erste: Beim anzeigen des Popupmenüs (TrackPopupMenu...) verwende ich für die Position 200, 200. Die Frage ist, wie kann ich die aktuelle Position des Mauszeiger abfragen ???

Die zweite: Es ist im Moment so, das das Menü einwandfrei erscheint, allerdings nicht mehr verschweindet, wenn ich außerhalb des menüs klicke. WARUM ???

das erste werd ich mal ausprobieren.

zum zweiten tip: MNS_AUTODISMISS sorgt dafür, das das menü nach 10 sec, die der mauszeiger sich nicht mehr darin befindet automatisch schließt. das habe ich bloß eingrfügt, das sich das menü überhaupt irgendwann einmal schließt.

hab die lösung gefunden.

das fenster muß im vordergrund liegen. also vorher SetForegroundWindow(...); aufrufen.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.