MuteForSkype pluginy. Dokumentace a příklad

Zveřejněno 12 února 05 11:51 odp. | 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 února 16, 2005 12:24:
dobrý den, kam chcete oznamovat bugreport? sem do fora? mel bych 2 problémy...
# Michal said on února 16, 2005 13:11:
idealne sem do tohoto fora:

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

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

# Joshua said on listopadu 18, 2006 3:58:

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

# vad said on listopadu 21, 2006 15:49:

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

# Derik said on listopadu 24, 2006 0:14:

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

# Barbara said on listopadu 24, 2006 14:27:

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

# Jacob said on listopadu 26, 2006 2:18:

It very interesting http://ashleylaurenproducts.com/

# Joshua said on listopadu 26, 2006 22:39:

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

# buy cialis online said on listopadu 30, 2006 12:12:

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 listopadu 30, 2006 12:12:

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 prosince 1, 2006 15:42:

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 prosince 5, 2006 9:54:

Hi all!

it's a good site!!

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

# generic cialis said on prosince 6, 2006 15:57:

Hi all!

it's a good site!!

http://0rz.tw/4b2bU

# Jenna Jameson said on prosince 8, 2006 7:51:

Hi all!

very good site!!

http://myblog.es/jennajameson

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

Carmen Electra ***

http://myblog.es/carmenelectra

# Torrie Wilson said on prosince 9, 2006 19:06:

Torrie Wilson

http://torriewilson.cn.to

# Trish Stratus said on prosince 11, 2006 18:05:

Trish Stratus

http://tiny.pl/9tpx

# topamax warnings said on prosince 14, 2006 10:37:

topamax warnings

http://myblog.es/topamax/

# topamax warnings said on prosince 14, 2006 10:38:

topamax warnings

http://myblog.es/topamax/

# topamax warnings said on prosince 14, 2006 10:38:

topamax warnings

http://myblog.es/topamax/

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

torrie wilson and sable

http://myblog.es/torrie-wilson

# ephedra addiction said on prosince 17, 2006 9:55:

ephedra addiction

http://myblog.es/ephedra

# wwe trish stratus said on prosince 18, 2006 13:26:

wwe trish stratus

http://myblog.es/trish-stratus

# vohat said on prosince 18, 2006 15:09:

kivutowuve

# George said on prosince 18, 2006 16:08:

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

# Jacob said on prosince 19, 2006 22:42:

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

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

free to watch adult web cams

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

# Zachary said on prosince 21, 2006 20:03:

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

# John said on prosince 24, 2006 0:19:

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

# Michael said on prosince 24, 2006 14:45:

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

# Joshua said on prosince 24, 2006 16:31:

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

# John said on prosince 28, 2006 11:00:

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

# John said on prosince 28, 2006 14:57:

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

# Matthew said on prosince 29, 2006 0:42:

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

# Emily said on prosince 30, 2006 4:49:

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

# Kenton said on ledna 16, 2007 9:43:

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 ledna 20, 2007 3:44:

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

# cash advance credit card said on ledna 26, 2008 0:27:

Here is america cash loan payday probabilit� poker

# McfarlandRhea31 said on září 4, 2010 21:33:

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 září 9, 2010 5:43:

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 září 13, 2010 14:58:

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 září 13, 2010 17:26:

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 září 13, 2010 19:22:

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 září 15, 2010 19:00:

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 září 28, 2010 9:21:

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 října 13, 2010 13:06:

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 října 13, 2010 13:27:

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 října 18, 2010 13:06:

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 listopadu 17, 2010 14:46:

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

# Amberly said on prosince 21, 2011 6:20:

Yup, that sohuld defo do the trick!

# jgubosqh said on prosince 22, 2011 11:30:

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

# evmsvvxho said on prosince 22, 2011 15:35:

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

# ttyotmd said on prosince 23, 2011 12:28:

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

    Vyvojar.cz na prodej!