MuteForSkype pluginy. Dokumentace a příklad

Zveřejněno 12 February 05 11:51 PM | michal 

Dokumentace rozhraní IMuter a třídy PluginInfo použité v rozhraní. V tomto článku ve zkrácené verzi, v Skype.Extension.IMuter.chm v plné verzi.

A nádavkém zdrojový kód pluginu pro Windows Media Player. V pluginu je použito část kódu z článku Alexandera Kenta.

A podpora dalších přehrávačů je teď na vás :-)

using System;
using System.Runtime.InteropServices;
namespace Devmasters.Util.Skype.Plugin.WMP_RemoteControl
{
 
 public class WMP : Devmasters.Util.Media.MuteForSkype.Extension.IMuter 
 {
  public void StartPlayer()
  {
   SetWMPHandle();
   if (bIsConnected)
   {
    Win32.SendMessage(iHandle, Win32.WM_COMMAND, 0x00004978, 0x00000000);
   }
  }
  public void MutePlayer()
  {
   SetWMPHandle();
   if (bIsConnected)
   {
    Win32.SendMessage(iHandle, Win32.WM_COMMAND, 0x00004979, 0x00000000);   
   }
  }
  public void  Configure(System.Windows.Forms.IWin32Window parent)
  {
  }
  public Devmasters.Util.Media.MuteForSkype.Extension.PluginInfo Info
  {
   get
   {
    Devmasters.Util.Media.MuteForSkype.Extension.PluginInfo i = new Devmasters.Util.Media.MuteForSkype.Extension.PluginInfo();
    i.Copyright="(c) 2005 Devmasters. Michal Blaha.";
    i.MoreInfoText="";
    i.URL="http://blog.vyvojar.cz/michal/";
    i.Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
    i.FriendlyName ="Mute for Windows Media Player ";
    return i ;
   }
  }
  public bool HasConfiguration
  {
   get
   {
    return false;
   }
  }
  public Devmasters.Util.Media.MuteForSkype.Extension.IMuter.PlayerStatusEnum PlayerStatus
  {
   get
   {
    return Devmasters.Util.Media.MuteForSkype.Extension.IMuter.PlayerStatusEnum.Unknown ;
   }
  }
  private System.Int32 iHandle;
  private bool bIsConnected = false;
  private void SetWMPHandle()
  {
   iHandle = Win32.FindWindow("WMPlayerApp", "Windows Media Player"); 
   if (iHandle.Equals(IntPtr.Zero)) 
   {
    bIsConnected=false;
   }
   else
   {
    bIsConnected = true;
   }
  }
  public bool IsPlayerConnected
  {
   get {return bIsConnected ;}
  }
 }
 
 
 /// <summary>
 /// Summary description for Win32.
 /// </summary>
 class Win32
 {
  // The WM_COMMAND message is sent when the user selects a command item from a menu, 
  // when a control sends a notification message to its parent window, or when an 
  // accelerator keystroke is translated.
  public const int WM_CMMAND = 0x111;
  // The FindWindow function retrieves a handle to the top-level window whose class name
  // and window name match the specified strings. This function does not search child windows.
  // This function does not perform a case-sensitive search.
  [DllImport("User32.dll")]
  public static extern int FindWindow(string strClassName, string strWindowName);
  // The FindWindowEx function retrieves a handle to a window whose class name 
  // and window name match the specified strings. The function searches child windows, beginning
  // with the one following the specified child window. This function does not perform a case-sensitive search.
  [DllImport("User32.dll")]
  public static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string strClassName, string strWindowName);
  // The SendMessage function sends the specified message to a 
  // window or windows. It calls the window procedure for the specified 
  // window and does not return until the window procedure has processed the message. 
  [DllImport("User32.dll")]
  public static extern Int32 SendMessage(
   int hWnd,               // handle to destination window
   int Msg,                // message
   int wParam,             // first message parameter
   [MarshalAs(UnmanagedType.LPStr)] string lParam); // second message parameter
  [DllImport("User32.dll")]
  public static extern Int32 SendMessage(
   int hWnd,               // handle to destination window
   int Msg,                // message
   int wParam,             // first message parameter
   int lParam);   // second message parameter
  public Win32()
  {
   
  }
  ~Win32()
  {
  }
 }
}



Skype.Extension.IMuter Documentation

PluginInfo Members

PluginInfo overview

Public Instance Constructors

PluginInfo Constructor Initializes a new instance of the PluginInfo class.

Public Instance Fields

Copyright Copyright informations
FriendlyName
MoreInfoText Description, more informations about plugin
URL Support URL for plugin. Could be empty
Version Plugin version

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) Gets the Type of the current instance.
ToString

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

IMuter Members

IMuter overview

Public Instance Properties

HasConfiguration Returns true if is configurable with GUI
Info Plugin info
IsPlayerConnected Is player detected? Returns true, if plugin is able to communicate with player
PlayerStatus Actual player status. Not used.

Public Instance Methods

Configure Opens WinForm with plugin configuration. Not used in this version.
MutePlayer Is called before call started. Stopped player sound (stop, pause, mute....)
StartPlayer Is called after call stopped. Restores player to previous status.

See Also

IMuter Interface | Devmasters.Util.Media.MuteForSkype.Extension Namespace


Vedeno pod: ,

Upozornění na nové komentáře

Pokud chčeš dostávat upozornění emailem na změny u toho příspěvku,tak se zaregistruj zde.zde

Odebírat komentáře k tomuto příspěvku pomocí RSS

Komentář

# Michal Zobec said on February 16, 2005 12:24 PM:
dobrý den, kam chcete oznamovat bugreport? sem do fora? mel bych 2 problémy...
# michal said on February 16, 2005 1:11 PM:
idealne sem do tohoto fora:

http://www.vyvojar.cz/Default.aspx?tabid=37&g=topics&f=41
# Hannah said on November 15, 2006 8:59 AM:

this site rocks! http://wwwwtahoo.com/firm-law-lexington-review/

# Joshua said on November 18, 2006 3:58 AM:

VERY GOOD I THINK http://wwwwtahoo.com/inkjet-kit-lexmark-refill/

# vad said on November 21, 2006 3:49 PM:

hello world <a href="http://www.beepworld.it/memberdateien/members/pica111/">Bachelor degree</a>

# Derik said on November 24, 2006 12:14 AM:

Your hard work paid off <a href="http://www.beepworld.it/members/borrowing-money/">borrowing money</a>

# Barbara said on November 24, 2006 2:27 PM:

Very useful http://wwwwtahoo.com/hp-print-cartridge/

# Jacob said on November 26, 2006 2:18 AM:

It very interesting http://ashleylaurenproducts.com/

# Joshua said on November 26, 2006 10:39 PM:

VERY GOOD I THINK http://wwwwtahoo.com/inkjet-cartridge/

# buy cialis online said on November 30, 2006 12:12 PM:

it's a good site !

[url=http://seoblad.sblog.cz/]buy cialis online[/url]

<a href="http://seoblad.sblog.cz/">buy cialis online</a>

# buy cialis online said on November 30, 2006 12:12 PM:

it's a good site !

[url=http://seoblad.sblog.cz/]buy cialis online[/url]

<a href="http://seoblad.sblog.cz/">buy cialis online</a>

# generic cialis said on December 1, 2006 3:42 PM:

it's a good site !

<a href="http://urlbounce.com/go/HSWSp">generic">http://urlbounce.com/go/HSWSp">generic cialis</a>

[url=http://urlbounce.com/go/HSWSp]generic cialis[/url]

# buy accutane online said on December 5, 2006 9:54 AM:

Hi all!

it's a good site!!

http://fresh.wikispaces.com/space/showimage/buy-accutane.html

# generic cialis said on December 6, 2006 3:57 PM:

Hi all!

it's a good site!!

http://0rz.tw/4b2bU

# Jenna Jameson said on December 8, 2006 7:51 AM:

Hi all!

very good site!!

http://myblog.es/jennajameson

# Carmen Electra *** said on December 9, 2006 8:17 AM:

Carmen Electra ***

http://myblog.es/carmenelectra

# Torrie Wilson said on December 9, 2006 7:06 PM:

Torrie Wilson

http://torriewilson.cn.to

# Trish Stratus said on December 11, 2006 6:05 PM:

Trish Stratus

http://tiny.pl/9tpx

# topamax warnings said on December 14, 2006 10:37 AM:

topamax warnings

http://myblog.es/topamax/

# topamax warnings said on December 14, 2006 10:38 AM:

topamax warnings

http://myblog.es/topamax/

# topamax warnings said on December 14, 2006 10:38 AM:

topamax warnings

http://myblog.es/topamax/

# torrie wilson and sable said on December 16, 2006 11:37 AM:

torrie wilson and sable

http://myblog.es/torrie-wilson

# ephedra addiction said on December 17, 2006 9:55 AM:

ephedra addiction

http://myblog.es/ephedra

# wwe trish stratus said on December 18, 2006 1:26 PM:

wwe trish stratus

http://myblog.es/trish-stratus

# vohat said on December 18, 2006 3:09 PM:

kivutowuve

# George said on December 18, 2006 4:08 PM:

Very good website http://portaldiscount.com/fast-cash/

# Jacob said on December 19, 2006 10:42 PM:

Interesting site http://portaldiscount.com/johnny-cash-and-june-carter/

# free to watch adult web cams said on December 20, 2006 11:08 AM:

free to watch adult web cams

http://myblog.es/adult-web-cams

# Zachary said on December 21, 2006 8:03 PM:

It very interesting http://portaldiscount.com/consumer-credit-counseling/

# John said on December 24, 2006 12:19 AM:

Hi, nice site! http://portaldiscount.com/easy-forex/

# Michael said on December 24, 2006 2:45 PM:

Hi, nice site! http://portaldiscount.com/selling-home/

# Joshua said on December 24, 2006 4:31 PM:

i like you! http://portaldiscount.com/home-remedy/

# John said on December 28, 2006 11:00 AM:

VERY GOOD I THINK http://portaldiscount.com/debt-problem/

# John said on December 28, 2006 2:57 PM:

Thank you... http://portaldiscount.com/work-at-home/

# Matthew said on December 29, 2006 12:42 AM:

This great resource http://portaldiscount.com/cash-back/

# Emily said on December 30, 2006 4:49 AM:

Good Luck! http://portaldiscount.com/cash-advance-loan/

# Kenton said on January 16, 2007 9:43 AM:

http://c0a7279c517e7e56a4b68236606c261d-t.dh4t5gef.info <a href="http://c0a7279c517e7e56a4b68236606c261d-h.dh4t5gef.info">c0a7279c517e7e56a4b68236606c261d</a> [url]http://c0a7279c517e7e56a4b68236606c261d-b1.dh4t5gef.info[/url] [url=http://c0a7279c517e7e56a4b68236606c261d-b2.dh4t5gef.info]c0a7279c517e7e56a4b68236606c261d[/url] Broken Hearthttp://c0a7279c517e7e56a4b68236606c261d-b3.dh4t5gef.info[/u]

# Britney Spears said on January 20, 2007 3:44 AM:

http://www.farlopon.com/prueba/images/britney-spears-nude.html

# cash advance credit card said on January 26, 2008 12:27 AM:

Here is america cash loan payday probabilit� poker

# McfarlandRhea31 said on September 4, 2010 9:33 PM:

Buildings are not very cheap and not everybody is able to buy it. Nevertheless, <a href="http://bestfinance-blog.com">loans</a> was created to help different people in such hard situations.

# thesis service said on September 9, 2010 5:43 AM:

There are a lot of buy dissertation and thesis service but your superior data about this topic. Therefore, to know more you should buy the dissertation idea.

# written essays said on September 13, 2010 2:58 PM:

If you are confused and don’t really know the way to perform the writing a research report, you will be able to buy a essay in the experienced term papers writing service. This should really save time.

# buy custom essay papers said on September 13, 2010 5:26 PM:

We clearly understand that your grade relies on good completed academic assignments. I state that is reasonable to buy college research paper and be sure that all is getting well with your academic career.  

# writing services said on September 13, 2010 7:22 PM:

I heard about online essays service, but, I did not decide to order essay papers online. Thus I pushed a link, which removed myself to term papers writing organization and I purchased term paper and was satisfied with an outcome.  

# term paper writing said on September 15, 2010 7:00 PM:

Students need a long time to see the issue of the do my paper essays. But if you can not write, that will be much better to buy an essay paper. Then that will be real to save reputation.

# essay samples said on September 28, 2010 9:21 AM:

Cannot see anyone who can aid you with term papers completing? Worry no more! I should recommend experienced writing service , which can help you. Hence, you won't get any difficulties with papers finishing and formatting.  

# buy essay said on October 13, 2010 1:06 PM:

No thing in this world is as pleasant as academic results approaching and there is real to buy essays to make true your desires!

# buy term paper said on October 13, 2010 1:27 PM:

Sometimes different students do know the proper way to create the written essays. But if you’re not experienced paper writer, you would have to seek the trustworthy write my essay service to order your essay assignment with the aim to have a success.

# online essays said on October 18, 2010 1:06 PM:

Simple minded high school students care about their academic future, hence they utilize a experienced buy essays online service, which is essential.

# our service said on November 17, 2010 2:46 PM:

Our social order can have some knowledge about our costs. Sometimes we charge top custom essay just about this good post.

# Amberly said on December 21, 2011 6:20 AM:

Yup, that sohuld defo do the trick!

# jgubosqh said on December 22, 2011 11:30 AM:

p8GRMb  <a href="http://sngrzbxtzmmg.com/">sngrzbxtzmmg</a>

# evmsvvxho said on December 22, 2011 3:35 PM:

6syNc7 , [url=http://bbcyrebvtitc.com/]bbcyrebvtitc[/url], [link=http://okinuxchtaoj.com/]okinuxchtaoj[/link], http://ynxxznkyuulo.com/

# ttyotmd said on December 23, 2011 12:28 PM:

QWlghk  <a href="http://mnxwpezgufmt.com/">mnxwpezgufmt</a>

Vytvoření nového komentáře

(povinný) 
(nepovinný)
(povinný) 
Opiš čísla, která vidíš na obrázku:

Search

Go


    Syndication