在Winapi中自定义扩展桌面 [英] customizing extended desktops in winapi

查看:183
本文介绍了在Winapi中自定义扩展桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

长话短说,我想与其他屏幕一起工作并做很多事情. 1)我想创建它自己的任务栏. 2)我希望能够设置它自己的个人桌面背景.为了实现这些目标,我有几个问题.扩展桌面如何工作?是一个大的变形窗口,还是多个窗口?我如何获取和操作一个或多个窗口?任务栏是可以创建的控件,还是我必须构建自己的任务栏控件?我知道模糊的问题,但我不知道从哪里开始.是的,我知道已经有多种软件可以执行此操作,我只是想为自己学习.

解决方案

我的意见:

#1
您必须自己做,这将需要大量工作.

#2
a)我不确定它是如何工作的.

b)桌面本质上就像一个大窗户.例如,如果辅助屏幕位于主屏幕的右侧,则其x坐标将从第一个屏幕的分辨率开始.例如,如果两个屏幕均为高清(1920x1080)并对齐,则桌面将为3840x1080,第二个屏幕的x坐标为1920和3840.主屏幕(主屏幕)的左上角始终为0, 0.因此,如果辅助屏幕在左侧,则坐标将为负.

诸如WM GETMINMAXINFO之类的消息将返回包含窗口最大部分的屏幕坐标,以便始终在最大的窗口中最大化窗口.

当有多个屏幕时,Windows会执行一些技巧...例如,最大化应用程序的边框,以使像素不会在相邻的显示器中显示.通常,最大化的窗口会更小一些,并且在使用多个屏幕时会显示边界.

c)默认任务栏由Windows处理.如果需要自己的,则可能必须自己编写完整的代码.

***要使某件作品行之有效,将需要大量的工作,您可能需要专门处理一些程序.


看看Windows工作站 [


long story short, i would like to work with other screens and do multiple things. 1) i would like to create it''s own taskbar. 2) i would like to be able to set it''s own individual desktop background. To accomplish these goals, I''ve got a couple questions. how does the extended desktop work? is it one big misshapen window, or is it multiple windows? How do i get and manipulate the window/windows? Is the taskbar a control that can be created, or would i have to build my own taskbar control? vague questions, i know, but i have no idea where to begin. And yes, i''m aware there are multiple softwares that do this out the already, i just want to learn for myself.

解决方案

My opinion:

#1
You have to do it yourself and it would be a lot of work.

#2
a) I''m not sure how that works.

b) The desktop is essentially like a big windows. For exampl if you secondary screen is at right of the main screen, it x coordinate would start at the resolution of the first screen. As an example, if both screen are HD (1920x1080) and aligned, then the desktop would be 3840x1080 and the second screen would have it x coordinate between 1920 and 3840. The main(primary screen) always has it top-left at 0,0. Thus if the secondary screen is on left, coordinates would be negative.

Message like WM GETMINMAXINFO will return the coordinate of the screen that contain the biggest portion of a windows so that a windows will always be maximized in the screen where it is the biggest.

Windows does some tricks when there are multiple screen... for example with the border of a maximized application so that pixels won''t be displayed in adjacent monitor. Typically a maximized windows would be a bit smaller and display it border when multiple screens are used.

c) Default taskbar is handled by Windows. If you want your own, then you probably have to code them completly by yourself.

*** To make something that works, it would be a lot of works and you would probably need to handle some program specifically.


have a look at Windows Stations[^]

*Many* years ago I wrote a sysTray app that would switch between a ''Development'' desktop and a ''Admin'' desktop


这篇关于在Winapi中自定义扩展桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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