高亮鼠标下的控件区域

; 高亮鼠标下的控件区域

#SingleInstance Force

; ------------ 创建主窗口
  Gui, Color, White
  Gui, 1:+hwndhMainGui
  Gui, Add, Button, , test
  Gui, Add, GroupBox, w300 h100, box1
  Gui, Add, Checkbox, xp+10 yp+25 Section, option1
  Gui, Add, Checkbox, xs, option2
  Gui, Add, Checkbox, xs, option3

  Gui, Add, GroupBox, xm w300 h100 cBlue, box2
  Gui, Add, Checkbox, xp+10 yp+25 Section, option1
  Gui, Add, Checkbox, xs, option2
  Gui, Add, Checkbox, xs, option3

; ------------ 创建透明遮罩窗口
  Gui, Trans: +ToolWindow  +LastFound +hwndhTrans -caption +toolwindow +0x02000000  +Owner1
  Gui, Trans: Color, Green
  WinSet, Transparent, 50
  WinSet, ExStyle, +0x20     ; 鼠标穿透

OnMessage(0x200, "MyFunc")
Gui, Show
return

Buttontest:
  Gui, +OwnDialogs
  MsgBox, test
Return

MyFunc() {
    global

    MouseGetPos,,,, c
    if !c
    {
      Gui, Trans:Cancel
      ToolTip
      Return
    }

    if c not in Button2,Button6
      Return

    if (c = "Button2")
      Gui, Trans: Color, Green
    else
      Gui, Trans: Color, Red
  
    GuiControlGet, p, Pos, %c%
    cX := pX, cY := pY
    ClientToScreen(hMainGui, cX, cY)
    Gui, Trans:Show, X%cX% Y%cY% w%pW% h%pH% NA

    ; ToolTip, % c "`n" pX "," pY " --- " pW "x" pH "`n" cX "," cY
}


; Coordinate Conversions by Lexikos
;http://tinyurl.com/k8uwvv8
ClientToScreen(hwnd, ByRef x, ByRef y)
{
    VarSetCapacity(pt, 8)
    NumPut(x, pt, 0)
    NumPut(y, pt, 4)
    DllCall("ClientToScreen", "uint", hwnd, "uint", &pt)
    x := NumGet(pt, 0, "int")
    y := NumGet(pt, 4, "int")
}

给TA捐赠
共{{data.count}}人
人已捐赠
其他案例

验证码识别

2020-3-9 6:25:44

其他案例

高亮鼠标下的控件区域(全屏幕)

2020-3-9 6:27:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索