public void Initialize() { try { prepareCollections(); trayDelegate = SysTrayCallback; iconDataDelegate = IconDataCallback; trayHostSizeDelegate = TrayHostSizeCallback; ExplorerTrayService.Instance.SetSystrayCallback(trayDelegate); ExplorerTrayService.Instance.Run(); TrayService.Instance.SetSystrayCallback(trayDelegate); TrayService.Instance.SetIconDataCallback(iconDataDelegate); TrayService.Instance.SetTrayHostSizeCallback(trayHostSizeDelegate); Handle = TrayService.Instance.Initialize(); TrayService.Instance.Run(); // load the shell system tray objects (network, power, etc) shellServiceObject = new ShellServiceObject(); shellServiceObject.Start(); } catch { IsFailed = true; } }
public void SetTrayHostSizeCallback(TrayHostSizeDelegate theDelegate) { trayHostSizeDelegate = theDelegate; }