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.

CMenu InsertMenu - Frage

Empfohlene Antworten

Veröffentlicht

Hallo,

ich versuche in der Menüleiste ein neues Element einzubinden (wie "Datei") und anschließend mehrere Unterelemente (wie "Neu", "Öffnen" etc.)

hier der Code:

CMenu *pMenu = GetMenu();

iPos = 3 // Kommt normalerweise als Übergabeparameter

//Oberpunkt erstellen (z.B. Datei)

pMenu->InsertMenu(iPos, MF_BYPOSITION, MF_SEPARATOR, "Datei");

DrawMenuBar();

//Anzahl aller Items ermitteln und nach der mit Beschriftung "Datei" suchen

int iMenuSize = pMenu->GetMenuItemCount();

for( int i = 0; i < iMenuSize; i++)

{

CString szTmp;

pMenu->GetMenuString(i, szTmp, MF_BYPOSITION );

if( szTmp == "Datei" )

{

//Und hier kriege ich keinen gültigen Handle! Wieso???

CMenu* pSubmenu = pMenu->GetSubMenu(i);

//Array mit Menüelementen

int iMax = m_aMenuArray.GetSize();

for (int a=0; a<iMax ;a++)

{

MenuStruktur = m_aMenuArray.GetAt(a);

pSubmenu->InsertMenu(a, MF_BYPOSITION| MenuStruktur.uiMenuState, MenuStruktur.uiID, MenuStruktur.szText);

}

this->DrawMenuBar();

}

}

aifl :(

Gefunden! :)

Die Stelle wo der Oberpunkt erstellt wird kommt folgendes:

CMenu *pMenu = GetMenu();

MenuStruct MenuStruktur;

int iMenuSize = pMenu->GetMenuItemCount();

CMenu NewPopupMenu;

NewPopupMenu.CreatePopupMenu();

HMENU hNewMenu = NewPopupMenu.GetSafeHmenu();

pMenu->InsertMenu( m_iMenuPos, MF_BYPOSITION | MF_POPUP | MF_ENABLED, (UINT)hNewMenu, szMenu );

iMenuSize++;

NewPopupMenu.Detach();

Ein schönes Wochenende!

aifl :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.