Currently I am developing an Application that requires a System Tray icon (Windows). I realized that Cef has a builtin ContextMenu and I tried to implement it by calling RunContextMenu() when the user right clicks on the System tray Icon. But Whenever I call a callback the application keeps crashing with
[1126/160816.273:FATAL:cef_scoped_refptr.h(276)] Check failed: ptr_.
I tried to also implement OnBeforeContextMenu() but i still dont get a menu displayed... Implementation inside root_window_win.cc
- Code: Select all
...
void RootWindowWin::OnBeforeContextMenu(CefRefPtr<CefMenuModel> model) {
model->AddItem(0, "Hellow World");
}
bool RootWindowWin::RunContextMenu(CefRefPtr<CefRunContextMenuCallback> callback) {
CEF_REQUIRE_UI_THREAD();
callback->Cancel();
return true;
}
...
I am also not really sure whether this is possible or not.