我该如何停靠我的应用程序? [英] how can i dock my application?

查看:79
本文介绍了我该如何停靠我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.imagehost.co.za/image-42E8_4FA942AF.jpg



如何让我的桌面工作区更小,并将我的应用程序停靠在像Facebook的信使一样右侧。所以,当我最大化其他一些应用程序时,它并没有隐藏我的dock

http://www.imagehost.co.za/image-42E8_4FA942AF.jpg

how can i make my desktop working area smaller and dock my apps on the right side like the facebook messenger. so, when i maximize some other application it doesn''t hide my dock

推荐答案

这是一个有趣的想法,但它无法在应用程序级别实现。这不是默认Windows桌面的设计方式。您是否最大化了某些应用程序,在一般情况下,它不是您的应用程序。它将以通常的方式最大化,完全忽略应用程序的特殊行为。你能看出它的后果吗?



同时,你想要的是什么,但是你需要针对另一方面解决这个问题。而且我不知道是否想接受挑战。从上面的段落中,您应该看到您所描述的布局只有在您开发了一些系统范围的实用程序时才可能提供某些功能,或某种替代方案(或者另外一种,没有大的选择)桌面。



我知道这是因为我做过类似的事情(桌面类似于Linux的典型虚拟桌面;我不想描述这个项目,因为它与你想要实现的完全不同)。对于简短的答案,您需要考虑的所有设计方法的描述都太长了,所以,只需要几个关键的想法:



您需要使用原始Windows API,可以访问所有窗口和桌面窗口,以适当地重新排列它们。或者,您可以替换整个桌面。要支持对接,您需要在实用程序中使用一些API,因此一些专门构建的应用程序可以获得它的好处。此API可以使用您选择的任何IPC,并且可以简单地实现为自定义Windows消息(例如将我停靠在右侧......)。到目前为止,我列出了非常微不足道的方面。非平凡的方面是这样的:当你调整大小最大化一些没有你的API开发的regulear应用程序时,它的位置仍然需要调整。为此,您需要使用全局Windows Hook:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms632589%28v=vs.85%29.aspx [ ^ ],

http:// msdn .microsoft.com / zh-CN / library / windows / desktop / ms644990%28v = vs.85%29.aspx [ ^ ]。



根据关于Hooks的Microsoft文档,制作一个全局钩子需要一个钩子(使用上面引用的方法)应该在一个单独的本机Windows DLL中设置,而不是在应用程序可执行文件中。使用钩子,特别是调试代码,是这项工作中最困难的部分。这真的需要严格的资格。



所以,你需要考虑一下你是否真的想搞砸所有这些。想想另一种选择:使用Windows 7并尝试使用Win + Left,Win + Right,Win + Top,Win + Bottom。不,这不是你想要的,而只是一些额外的,相当不错的布局功能(也应该启用系统设置)。也许,你不想要自己的桌面工具那么多? :-)



-SA
This is an interesting idea, but it cannot be implemented at the level of application. This is not how the default Windows desktop is designed. Is you you maximize some application, it is, in general case, not your application. It will be maximized in a usual way, totally ignoring "special" behavior of your application. Can you see to consequences of it?

At the same time, what you want is possible, but you need to approach this problem for a different side. And I don''t know if want to take the challenge. From the above paragraph, you should see that the layout you described is only possible if you develop some system-wide utility which should offer some functionality, or some kind of alternative (or additional, there is no big difference) desktop.

I know it because I''ve done something similar (a desktop similar to a virtual desktop typical for Linux; I don''t want to describe this project because it is very different from what you want to achieve). The description of just all design approaches you would need to consider would be too long for a short answer, so, just a couple of key thoughts:

You need to use raw Windows API to get access to all windows and a desktop window, to rearrange them appropriately. Alternatively, you can replace the whole desktop. To support docking, you will need to have some API in your utility, so some specially built applications could takes its benefits. This API can use any IPC of your choice, and can simply be implemented as a custom Windows message (such as "dock me on right"…). So far, I listed very trivial aspects. Non-trivial aspect is this: when you resize of maximize some "regulear" application developed without your API, it''s position still need to be adjusted. To do it you need to use global Windows Hooks:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632589%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644990%28v=vs.85%29.aspx[^].

According to Microsoft documentation on Hooks, making a hook global requires that a hook (using the method referenced above) should be set in a separate native Windows DLL, not in application executable. Working with hooks, and especially debugging of their code, is the most difficult part of this work. It will really require serious qualification.

So, you need to think if you really want to mess with all of it. Think about one alternative: use Windows 7 and try to use Win+Left, Win+Right, Win+Top, Win+Bottom. No, this is not what you want, but just some additional and pretty nice layout functionality (which should be also enabled is system settings). Maybe, you don''t want your own desktop utility that much? :-)

—SA


这篇关于我该如何停靠我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆