-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to load deskband another program? #41
Comments
you'll have to get an instance of |
Thanks, that work.in the program define ITrayDeskband.cs [ComImport, Guid("6D67E846-5B9C-4db8-9CBC-DDE12F4254F1"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITrayDeskband
{
[PreserveSig]
int ShowDeskBand([In, MarshalAs(UnmanagedType.Struct)] ref Guid clsid);
[PreserveSig]
int HideDeskBand([In, MarshalAs(UnmanagedType.Struct)] ref Guid clsid);
[PreserveSig]
int IsDeskBandShown([In, MarshalAs(UnmanagedType.Struct)] ref Guid clsid);
[PreserveSig]
int DeskBandRegistrationChanged();
} call in program ITrayDeskband obj = null;
Type trayDeskbandType = System.Type.GetTypeFromCLSID(new Guid("E6442437-6C68-4f52-94DD-2CFED267EFB9"));
try
{
obj = (ITrayDeskband)Activator.CreateInstance(trayDeskbandType);
Guid deskbandGuid = new Guid(DESKBAND_GUID)
obj.DeskBandRegistrationChanged();
hr = obj.ShowDeskBand(ref deskbandGuid);
if (hr != 0)
throw new Exception("Error while trying to show deskband: " + hr);
obj.DeskBandRegistrationChanged();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
finally
{
if (obj != null && Marshal.IsComObject(obj))
Marshal.ReleaseComObject(obj);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I registered deskband, but it need click taskbar toolbars to activate, how to activate it automatically?
The text was updated successfully, but these errors were encountered: