通过 Skype4COM.dll COM API 控制 Skype

发布于 2024-07-14 16:49:21 字数 458 浏览 7 评论 0原文

我正在使用 C# 来使用 Skype4COM.dll COM API,它适用于所有我们需要的通讯功能。 我们正在尝试在 Skype 之上放置一个更易于使用的界面,并将其融入到我们的应用程序中。

我的麻烦在于控制或禁用哪些 Skype 窗口使用和不使用。 我认为我需要的唯一 Skype 窗口是 Skype 视频电话/会议窗口。 我想隐藏和控制 Skype 可以显示的所有其他窗口。 我什至想禁用来电时弹出的来电对话框窗口,因为我们将显示自己的应答提示。 除了窗口管理之外,我对 API 很满意。

通过 API,我可以看到如何启用 Windows,但我似乎不知道如何隐藏它们,除非将 Windows 消息破解到 Skype 应用程序。 我错过了什么吗?

感谢您的帮助,肯尼

I'm working with the Skype4COM.dll COM API using C# and it works very well for all of the communication functionality we need. We are trying to put an easier to use interface on top of Skype that is baked into our application.

My trouble lies in controlling or disabling which Skype windows to use and not use. The only Skype window I believe I'll need is the Skype video phone/conference window. I would like to hide and control every other window that Skype can present. I would even like to disable the incoming call dialog window that pops up on incoming calls, since we'll be presenting our own answer prompt. I'm happy with the API except window management.

With the API, I can see how to enable Windows, but I can't seem to figure out how to hide them, short of hacking a windows message to the Skype app. Am I missing something?

Thanks for your assistance, Kenny

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

羁绊已千年 2024-07-21 16:49:21

经过一番研究,我们发现您可以通过发送“Skype 命令”,

skypeobj.SendCommand ( Command cmd );

这对于我们的大部分需要来说都非常有效。 以下是 Skype 开发人员网站上的参考

一些代码:

    void _SendSkypeCommand ( string cmdToSend )
    {
        Command cmdSkype = new Command ();
        cmdSkype.Blocking = true;
        cmdSkype.Timeout = 2000;
        cmdSkype.Command = cmdToSend;
        Trace.WriteLineIf ( _TracingDetailed, string.Format ( "skype command sent '{0}'", cmdToSend ) );
        _skype.SendCommand ( cmdSkype );
    }

    void _hideSkypeWindows ()
    {
        _SendSkypeCommand ( "SET SILENT_MODE ON" );
        _SendSkypeCommand ( "SET WINDOWSTATE HIDDEN" );
    }

Poking around a bit we found that you can send 'Skype Commands' via

skypeobj.SendCommand ( Command cmd );

That works pretty well for most of what we need. Here is a reference on the Skype developer site:

Some code:

    void _SendSkypeCommand ( string cmdToSend )
    {
        Command cmdSkype = new Command ();
        cmdSkype.Blocking = true;
        cmdSkype.Timeout = 2000;
        cmdSkype.Command = cmdToSend;
        Trace.WriteLineIf ( _TracingDetailed, string.Format ( "skype command sent '{0}'", cmdToSend ) );
        _skype.SendCommand ( cmdSkype );
    }

    void _hideSkypeWindows ()
    {
        _SendSkypeCommand ( "SET SILENT_MODE ON" );
        _SendSkypeCommand ( "SET WINDOWSTATE HIDDEN" );
    }
说不完的你爱 2024-07-21 16:49:21

不幸的是,该界面实际上并不能让您控制实际的窗口,只能提供显示和修改它们的方法(通过包装器)。

正如您所说,您必须以某种方式获取窗口的句柄,然后发送一条消息来隐藏它。

Unfortunately, the interface doesn't actually give you control over the actual windows, only methods to display and modify them (through wrappers).

As you said, you will have to get the handle of the window somehow and then send a message to hide it.

拍不死你 2024-07-21 16:49:21

我有同样的问题,并且

_SendSkypeCommand ("SET SILENT_MODE ON");

已被破坏,正如这篇文章所述: http://devforum.skype.com/t5/Desktop-API/How-to-keep-hidden-Skype-UI-using-Skype4COM/td-p/12338

我的解决方案是通过将 Skype UI 的窗口移出显示区域来使其不可见。

现在代码:

 [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
    [DllImport("user32.dll", SetLastError = true)]
    internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);        
    IntPtr hwnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "tSkMainForm", null);//find skype window                  
    MoveWindow(hwnd, 2300, 2300, 300, 400, true);

I have same problem, and the

_SendSkypeCommand ( "SET SILENT_MODE ON" );

has been broken, as it is said on this post: http://devforum.skype.com/t5/Desktop-API/How-to-keep-hidden-Skype-UI-using-Skype4COM/td-p/12338

My solution is make skype UI invisible by moving it's window out of display area.

Now code:

 [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
    public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
    [DllImport("user32.dll", SetLastError = true)]
    internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);        
    IntPtr hwnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "tSkMainForm", null);//find skype window                  
    MoveWindow(hwnd, 2300, 2300, 300, 400, true);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文