aa147147 发表于 2009-5-9 22:58:23

每周任务B,完成。请指教..
#include <Misc.au3>
TrayTip ( "每周任务B", "当按住CTRL键时,如果鼠标指针在屏幕右上角则最小化当前窗口,左上角时则关闭当前窗口,左下角时则隐藏当前窗口,右下角时显示隐藏的窗口.alt+d退出",60)


While 1
    sleep (100)
    $xy=MouseGetPos()
    $title = WinGetTitle("", "")
    $Handle = WinGetHandle ($title, "")
    If _IsPressed("11", "user32.dll") And $xy <50And $xy <50Then;左上角时则关闭当前窗口
      IF $title <> "Program Manager" Then WinClose ($title, "")
    Endif
   IF _IsPressed("11", "user32.dll") And $xy < 50 And $xy > int (@DesktopHeight - 50)Then ;左下角时则隐藏当前窗口
      IF $title <> "Program Manager" Then WinSetState ( $title, "", @SW_HIDE)
   Endif
   IF _IsPressed("11", "user32.dll") And $xy > int (@DesktopWidth - 50) And $xy > int (@DesktopHeight - 50) Then ;右下角时显示隐藏的窗口
   IF $title <> "Program Manager" Then WinSetState ( $title, "", @SW_SHOW)
   Endif
   IF _IsPressed("11", "user32.dll") And $xy > int (@DesktopWidth - 50) And $xy < int (@DesktopHeight - 50) Then ;右上角则最小化当前窗口
   IF $title <> "Program Manager" Then WinSetState ( $title, "", @SW_MINIMIZE)
   Endif
   HotKeySet ( "!d", "ext")
WEnd



func ext()
TrayTip( "每周任务B", "你选择了退出哦",2)
sleep(2000)
exit
endfunc

aa147147 发表于 2009-5-9 22:59:37

没发现论坛还有这个好地方,刚发现,真是好地方.

xiaohailin 发表于 2009-5-11 15:52:56

学习AutoIt从每天做起

aa147147 发表于 2009-5-11 17:56:34

每周任务A
可惜不完善,要手动去除自动排列,
还有就是要做到默认右边的话...还在努力中...

#include <GUIListView.au3>
Dim $num,$num_1=0
$hParent = WinGetHandle("Program Manager")
$hwnd = ControlGetHandle($hParent, "", "SysListView321")
_GUICtrlListView_SetView($hwnd, 3) ;小图标排列
_GUICtrlListView_SetItemPosition32($hwnd, 0, 1200, 0)
For $i = 1 to _GUICtrlListView_GetItemCount($hwnd)
   IF StringInStr ($i / 2, "." ) Then
      $Num = 20
   Else
      $Num = 10
   Endif
   $num_1 = $num_1 + $Num
    _GUICtrlListView_SetItemPosition32($hwnd, $i, 2000, $num_1)
Next

make2855 发表于 2009-5-12 20:46:48

老大发飙了,没想到老大文学水平这么高:face (37):

pcbar 发表于 2009-5-13 10:10:27

图标靠右的,
#include <GuiListView.au3>
Global $hWndManager = WinGetHandle("Program Manager")
Global $hWndDesktop = ControlGetHandle("Program Manager", "", 1)
$iCount = ControlListView($hWndManager, "", $hWndDesktop, "GetItemCount")
For $iIndex = 0 To $iCount - 1
        $xy = _GUICtrlListView_GetItemPosition($hWndDesktop, $iIndex)
        _GUICtrlListView_SetItemPosition($hWndDesktop, $iIndex, @DesktopWidth - 40 - $xy, $xy)
Next
同上,必须取消自动排列

wang561818 发表于 2009-5-13 20:16:08

都是高手 学习中

lynfr8 发表于 2009-5-13 21:32:08

#Include <SendMessage.au3>
#include <GuiListView.au3>
#Include <WinAPI.au3>
Global Const $GWL_STYLE               = 0xFFFFFFF0
Global Const $handle = WinGetHandle("Program Manager") ;窗口句柄
Global Const $ctrl = ControlGetHandle("Program Manager","","SysListView321");控件句柄
_SendMessage($ctrl, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_SNAPTOGRID, 0)      ;;取消对齐到网络
$dwStyle = _WinAPI_GetWindowLong($ctrl, $GWL_STYLE )
_WinAPI_setWindowLong($ctrl, $GWL_STYLE , BitAnd($dwStyle,BitNot($LVS_AUTOARRANGE)))   ;;取消自动排列

pcbar 发表于 2009-5-13 22:02:14

#Include <SendMessage.au3>
#include <GuiListView.au3>
#Include <WinAPI.au3>
Global Const $GWL_STYLE               = 0xFFFFFFF0
Global $hWndManager = WinGetHandle("Program Manager")
Global $hWndDesktop = ControlGetHandle("Program Manager", "", 1)
_SendMessage($hWndDesktop, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_SNAPTOGRID, 0)    ;;取消对齐到网络
$dwStyle = _WinAPI_GetWindowLong($hWndDesktop, $GWL_STYLE )
If BitAND($dwStyle, $LVS_AUTOARRANGE) Then _WinAPI_setWindowLong($hWndDesktop, $GWL_STYLE , BitAnd($dwStyle,BitNot($LVS_AUTOARRANGE)));取消自动排列

$iCount = ControlListView($hWndManager, "", $hWndDesktop, "GetItemCount")
For $iIndex = 0 To $iCount - 1
      $xy = _GUICtrlListView_GetItemPosition($hWndDesktop, $iIndex)
      _GUICtrlListView_SetItemPosition($hWndDesktop, $iIndex, @DesktopWidth - 40 - $xy, $xy)
Next

谢谢lynfr8。
前面不知道 $gwl_sytle这个参数如何设。

lynfr8 发表于 2009-5-13 22:44:10

本帖最后由 lynfr8 于 2009-5-13 22:59 编辑

不言谢,我还得多向你们学习
关于$gwl_sytle这个参数如何设
懂c++的可以借鉴此文
http://blog.chinaunix.net/u2/67530/showart_601459.html

aa147147 发表于 2009-5-15 18:05:54

但是还是有一个问题,如何把默认左边改成默认右边呢??ListView不知道怎么实现

lynfr8 发表于 2009-5-15 23:18:57

但是还是有一个问题,如何把默认左边改成默认右边呢??ListView不知道怎么实现
aa147147 发表于 2009-5-15 18:05 http://www.autoitx.com/images/common/back.gif

跟帖不是有吗?认真点看

zhuang513 发表于 2009-5-17 07:29:32

呀.迟到了
努力中..

KiwiCsj 发表于 2009-5-21 22:11:06

跌倒。赞叹。失语。

原来老大口才这么好。

一段时间没来,感觉老大发愤了?

caicaicaicaijj 发表于 2009-5-22 15:40:48

好啊!
希望老师坚持这个每周任务
顶!
页: 1 [2] 3 4 5
查看完整版本: 每周任务#1