menfan1 发表于 2011-12-24 10:32:47

Au3Info.exe

dabaiyun 发表于 2011-12-24 20:37:35

路过看看好代码 呀 支持了

whuzqAI 发表于 2014-11-18 16:53:15

好贴,留记号,代码含金量很高啊~

kk_lee69 发表于 2016-5-9 00:22:11

太精彩的代碼了留個腳印macgyver

hxx910203 发表于 2016-9-29 14:59:15

修改:1.边框闪烁。红色,透明交替
2.只在鼠标移到其他窗口或鼠标所在窗口位置改变是重绘边框#include <ProgressConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiConstants.au3>
#include <ButtonConstants.au3>
#include <BorderConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <ComboConstants.au3>
#include <Constants.au3>
#include <GDIPlus.au3>
#include <WinApi.au3>
#Include <Misc.au3>



Global $Color = 0x0
Global $hSquare_GUI = 0
Global $CurWin = 0 ;保存所在窗口
Global $CurWinPos = [-1, -1] ;窗口位置

While 1
      Sleep(200)
      If $Color = 0xFFFFFF Then
                $Color =0xFF0000
      Else
                $Color = 0xFFFFFF
                                If $hSquare_GUI <> 0 Then GUISetState(@SW_HIDE, $hSquare_GUI) ;隐藏边框
                                ContinueLoop
      EndIf
      
      Global $Struct = DllStructCreate($tagPoint)

      DllStructSetData($Struct, "x", MouseGetPos(0))
      DllStructSetData($Struct, "y", MouseGetPos(1))

      $hWinCtrl = _WinAPI_WindowFromPoint($Struct)
                Local $aCtrlPos = WinGetPos($hWinCtrl)
                ;当鼠标移到其他窗口,或所在窗口位置改变,重绘边框,否则显示边框
                If $CurWin <> $hWinCtrl Or ($aCtrlPos <> $CurWinPos Or $aCtrlPos <> $CurWinPos) Then
                        $CurWin = $hWinCtrl
                        GUIDelete($hSquare_GUI)
                        $hSquare_GUI = 0
                        $CurWinPos = $aCtrlPos
                        $CurWinPos = $aCtrlPos
                        GUICreateSquare($aCtrlPos, $aCtrlPos, $aCtrlPos, $aCtrlPos, $Color)
                Else
                        If $hSquare_GUI <> 0 Then GUISetState(@SW_SHOWNOACTIVATE, $hSquare_GUI) ;显示边框
                EndIf
WEnd

Func GUICreateSquare($i_X=-1, $i_Y=-1, $i_W=-1, $i_H=-1, $sColor=0x0)
      $hSquare_GUI = GUICreate("", $i_W, $i_H, $i_X, $i_Y, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
      Local $Frame_Width = 3
      
      GUISetBkColor($sColor)
      
      _GUISetHole($hSquare_GUI, $Frame_Width, $Frame_Width, $i_W - ($Frame_Width * 2), $i_H - ($Frame_Width * 2))
      GUISetState(@SW_SHOWNOACTIVATE, $hSquare_GUI)
EndFunc
;裁剪
Func _GUISetHole(ByRef $hWin, $i_X, $i_Y, $i_SizeW, $i_SizeH)
      Local $aWinPos, $Outer_Rgn, $Inner_Rgn, $Wh, $Combined_Rgn
      Local Const $RGN_DIFF = 4
      $aWinPos = WinGetPos($hWin)
      
      $Outer_Rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", $aWinPos, "long", $aWinPos)
      $Inner_Rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $i_X, "long", $i_Y, "long", $i_Y + $i_SizeW, "long", $i_Y + $i_SizeH)
      $Combined_Rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)
      DllCall("gdi32.dll", "long", "CombineRgn", "long", $Combined_Rgn, "long", $Outer_Rgn, "long", $Inner_Rgn, "int", $RGN_DIFF)
      DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWin, "long", $Combined_Rgn, "int", 1)
EndFunc

blue003 发表于 2019-7-12 09:40:50

真的很不错,谢谢
页: 1 [2]
查看完整版本: [已解决]请问当鼠标移到一个窗口上如何在这个窗口周围出现一个闪烁的框(界标线)