大家也来模仿一下这个软件《GiMeSpace》
本帖最后由 xyold1 于 2010-11-6 09:51 编辑去数动论坛里看了一下,发现一个很不错的小程序,GiMeSpace
原贴:http://bbs.icpcw.com/forum.php?mod=viewthread&tid=2014689&extra=page%3D1%26amp%3Bfilter%3Dtype%26amp%3Btypeid%3D165
介绍如下:
现在大家用电脑,一般都是多窗口,多任务同时运行,如果窗口一多,系统桌面就显得非常拥挤,操作不便。要是用GiMeSpace这款软件,就可以让你的桌面无限放大,而不用管显示器的大小!
GiMeSpace翻译成中文就是给我空间的意思,顾名思义就知道这是一款让你扩大桌面使用空间的工具。首先我们安装并运行GiMeSpace,接下来就可以在当前桌面上摆放窗口。当窗口不够放的时候,将鼠标移动到桌面的左方、右方边缘,就可以无限滚动你的桌面。
选择其中的一个窗口,然后按住鼠标左键不放进行拖拽,就可以将窗口放到任意一个位置上去。这样就可以将桌面的宽度无限放大,但同时显示的桌面区域限制在显示器的宽度。这样一来,就可以理论上放置无数个窗口,操作起来就会更加简单,不用再为找窗口而发愁。
如果桌面拖拽的比较长,不方便操作。可以按下键盘上的Scroll Lock键,就可以暂停桌面扩展功能,再按一下,恢复正常。要是拖拽桌面实在过长,找不到想要找到窗口也没有关系。在任务栏上点击GiMeSpace图标,选择Collect windows,把所有窗口收合到目前桌面中。
以后如果觉得自己的桌面不够大,就可以用GiMeSpace这款软件来帮忙。让桌面像画轴一样可以横向滚动,然后你可以在画布上轻松的把每个窗口放在上面,彼此绝不干扰。
当时看着很神奇,于是搜出这个软件来,运行一看,明白了,任何一个AU3入门的人都可以搞啊(想想AU3真的很强大)
于是也模仿着做了一个,功能上不如原版强,但也算是及格了吧
大家也试着做一下看看
又修改了一下,修正了上个版本的BUG,可以上下左右移动,可以调节速度,开启SCROLLLOCK不会移动窗口
另外官方的收费版还有更多的功能
- scrolling in 2 directions.
- able to make windows bigger then your physical screen. Very useful for
netbooks and other computer with small screens!
- adjust scroll speed.
- support for pen/touchscreen computers.
- 'sticky' scrolling, no more little moves when you hit the edge.
- select what windows should not scroll.
- adjust move and repaint refresh rate.
- always scrolling mode.
- navigation panel to show and navigate your whole extended desktop.
- do not scroll when a window is maximized.
- Auto arrange windows next to each other.
本人作品免金币下载地址:http://cid-c490728b0747d5f6.office.live.com/self.aspx/滚动窗口/movewin1.rar 本帖最后由 menfan1 于 2010-11-6 11:48 编辑
挺有意思的哈 回复 2# menfan1
是很有意思的程序{:face (327):} 确实挺有意思~ 原程序在,鼠标光标在屏幕边缘,并移动时,窗口才会移动,而我这个东西,只是判断了在屏幕边缘就移动,不知道怎么才能搞成那种效果
{:1_402:} 创建一个透明全屏窗口,捕捉其WM_MOUSEMOVE消息 本帖最后由 xyold1 于 2010-11-7 23:30 编辑
回复 6# afan
原来如此啊,还不能随心所欲地处理消息处理
{:face (300):}
下面是代码,有不对的还请大有指正
{:face (117):}
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=E:\TF卡备份\mynewwork\winvista图标\Icon_35.ico
#AutoIt3Wrapper_OutFile=movewin1.exe
#AutoIt3Wrapper_Res_Description=扩展屏幕
#AutoIt3Wrapper_Res_FileVersion=1.1.0.0
#AutoIt3Wrapper_Res_LegalCopyright=小数点儿
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <WinAPIEx.au3>
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <Misc.au3>
Opt("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
;~ TraySetIcon("", -1)
TraySetClick("8")
$MenuItem5 = TrayCreateItem("调节速度")
TrayCreateItem("")
$MenuItem4 = TrayCreateItem("上下移动")
TrayCreateItem("")
$MenuItem3 = TrayCreateItem("还 原")
TrayCreateItem("")
$MenuItem2 = TrayCreateItem("关 于")
TrayCreateItem("")
$MenuItem1 = TrayCreateItem("退 出")
TraySetState()
#EndRegion ### END Koda GUI section ###
Global $Data
Global Const $VK_SCROLL = 0x91
HotKeySet("{esc}", 'ExitAPP')
AdlibRegister("getdata", 1000)
setini()
$mov = RegRead("HKEY_CURRENT_USER\Software\Move_WindowUD\", "speed")
If $mov = "" Then
$mov = 10
EndIf
$loc = 5
$w = @DesktopWidth
$h = @DesktopHeight
Dim $posxx, $posyy
$dll = DllOpen("user32.dll")
TrayItemSetState($MenuItem4, RegRead("HKEY_CURRENT_USER\Software\Move_WindowUD\", "state"))
While 1
$nMsg = TrayGetMsg()
Switch $nMsg
Case $MenuItem5
$answer = InputBox("提示", "请输入一个数字", $mov)
If Not @error Then
If Number($answer) <> 0 Then
$mov = Number($answer)
RegWrite("HKEY_CURRENT_USER\Software\Move_WindowUD\", "speed", "REG_DWORD", $answer)
EndIf
EndIf
Case $MenuItem4
RegWrite("HKEY_CURRENT_USER\Software\Move_WindowUD\", "state", "REG_DWORD", TrayItemGetState($MenuItem4))
Case $MenuItem3
rest()
Case $MenuItem2
MsgBox(0, "关于", "小数点儿制作")
Case $MenuItem1
ExitAPP()
EndSwitch
If Not _GetKeyState($VK_SCROLL) Then
$size = WinGetPos("")
If $size < -$size - 20 Or $size > $w + 20 Or $size < -$size - 20 Or $size > $h + 20 Then
WinMove("", "", ($w - $size) / 2, ($h - $size) / 2)
EndIf
$tstate = BitAND(TrayItemGetState($MenuItem4), $TRAY_CHECKED)
$pos = MouseGetPos();返回一个包含鼠标坐标的2元素一维数组array: $array = X 坐标 (横向), $array = Y 坐标 (垂直)
If $pos > $w - 5 Then
gethwn("right")
If $tstate Then
If $pos > $posyy + $loc Then
gethwn("down")
ElseIf $pos < $posyy - $loc Then
gethwn("up")
EndIf
EndIf
EndIf
If $pos < 5 Then
gethwn("left")
If $tstate Then
If $pos > $posyy + $loc Then
gethwn("down")
ElseIf $pos < $posyy - $loc Then
gethwn("up")
EndIf
EndIf
EndIf
If $pos > $h - 5 Then
If $tstate Then gethwn("down")
If $pos > $posxx + $loc Then
gethwn("left")
ElseIf $pos < $posxx - $loc Then
gethwn("right")
EndIf
EndIf
If $pos < 5 Then
If $tstate Then gethwn("up")
If $pos > $posxx + $loc Then
gethwn("left")
ElseIf $pos < $posxx - $loc Then
gethwn("right")
EndIf
EndIf
$posxx = $pos
$posyy = $pos
EndIf
WEnd
Func _GetKeyState($VK_Code)
Local $ret = DllCall("user32.dll", "long", "GetKeyState", "long", $VK_Code)
Return $ret
EndFunc ;==>_GetKeyState
Func rest()
$Data = _WinAPI_EnumWindowsTop()
For $i = 1 To $Data
;~ $xe=IniRead("PosSet.db",$Data[$i],"x","none")
;~ $ye=IniRead("PosSet.db",$Data[$i],"y","none")
$xe = RegRead("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "x")
$ye = RegRead("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "y")
If $xe = "" And $ye = "" Then
Else
WinMove($Data[$i], "", $xe, $ye)
;~ IniWrite("PosSet.db",$Data[$i],"x",$winpos)
;~ EndIf
;~ $ye=IniRead("PosSet.db",$Data[$i],"y","none")
;~ If $ye="none" Then
;~ IniWrite("PosSet.db",$Data[$i],"x",$winpos)
EndIf
Next
EndFunc ;==>rest
Func ExitAPP()
$Data = _WinAPI_EnumWindowsTop()
For $i = 1 To $Data
;~ $xe=IniRead("PosSet.db",$Data[$i],"x","none")
;~ $ye=IniRead("PosSet.db",$Data[$i],"y","none")
$xe = RegRead("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "x")
$ye = RegRead("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "y")
If $xe = "" And $ye = "" Then
Else
WinMove($Data[$i], "", $xe, $ye)
;~ IniWrite("PosSet.db",$Data[$i],"x",$winpos)
;~ EndIf
;~ $ye=IniRead("PosSet.db",$Data[$i],"y","none")
;~ If $ye="none" Then
;~ IniWrite("PosSet.db",$Data[$i],"x",$winpos)
EndIf
Next
;~ FileDelete("PosSet.db")
RegDelete("HKEY_CURRENT_USER\Software\Move_Window\")
DllClose($dll)
Exit
EndFunc ;==>ExitAPP
Func setini()
$Data = _WinAPI_EnumWindowsTop()
For $i = 1 To $Data
$state = WinGetState($Data[$i])
If Not BitAND($state, 16) Or Not BitAND($state, 32) Then
$winpos = WinGetPos($Data[$i])
;~ $xe=IniRead("PosSet.db",$Data[$i],"x","none")
$xe = RegRead("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "x")
If $xe = "" Then
;~ IniWrite("PosSet.db",$Data[$i],"x",$winpos)
RegWrite("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "x", "REG_DWORD", $winpos)
EndIf
;~ $ye=IniRead("PosSet.db",$Data[$i],"y","none")
$ye = RegRead("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "y")
If $ye = "" Then
;~ IniWrite("PosSet.db",$Data[$i],"y",$winpos)
RegWrite("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "y", "REG_DWORD", $winpos)
EndIf
EndIf
Next
EndFunc ;==>setini
Func getdata()
$datanum = $Data
$Data = _WinAPI_EnumWindowsTop()
If $Data <> $datanum Then setini()
EndFunc ;==>getdata
Func gethwn($MP)
For $i = 1 To $Data
$state = WinGetState($Data[$i])
$winposA = WinGetPos($Data[$i])
If Not BitAND($state, 16) Then
Switch $MP
Case "left"
WinMove($Data[$i], "", $winposA + $mov, $winposA)
;~ IniWrite("PosSet.db",$Data[$i],"xn",$winposA+$mov)
RegWrite("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "xn", "REG_DWORD", $winposA + $mov)
Case "right"
WinMove($Data[$i], "", $winposA - $mov, $winposA)
;~ IniWrite("PosSet.db",$Data[$i],"xn",$winposA-$mov)
RegWrite("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "xn", "REG_DWORD", $winposA - $mov)
Case "up"
WinMove($Data[$i], "", $winposA, $winposA + $mov)
;~ IniWrite("PosSet.db",$Data[$i],"yn",$winposA+$mov)
RegWrite("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "yn", "REG_DWORD", $winposA + $mov)
Case "down"
WinMove($Data[$i], "", $winposA, $winposA - $mov)
;~ IniWrite("PosSet.db",$Data[$i],"yn",$winposA-$mov)
RegWrite("HKEY_CURRENT_USER\Software\Move_Window\" & $Data[$i], "yn", "REG_DWORD", $winposA - $mov)
EndSwitch
EndIf
Next
EndFunc ;==>gethwn 很无奈地使用了注册表,不知还有优化方法吗? 很强大的一个工具。谢谢分享,目前没有办法做这个东西 ,不会。我会关注你的。 我也来试试哈你们大家都来啊 怎么会自动退出的 回复 9# chenronting
谢谢,相互学习{:face (411):} 回复 11# tryhi
我这里运行正常,你可以跑一下原代码看看{:face (317):} 回复 13# xyold1
我这里也正常。不过点右下角还原的时候,会出现数组超出。 回复 14# chenronting
{:face (368):}
我再测试
页:
[1]
2