#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <Misc.au3>
#include <GuiConstants.au3>
#include <WindowsConstants.au3>
Global $MouseGui = GUICreate("pen", 1, 1, 1, 1, BitOR($WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS), _
BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
GUISetBkColor(0xFF0000, $MouseGui)
pen_DrawGuiRgn(2, 2, 100, 100, 0, 0)
Sleep(10000)
Func pen_DrawGuiRgn($BORDER_LF_RI_SIZE, $BORDER_TO_BO_SIZE, $WIDTH, $HEIGHT, $LEFT, $TOP) ;识图笔刷
Local $W = $BORDER_LF_RI_SIZE * 2 + $WIDTH
Local $H = $BORDER_TO_BO_SIZE * 2 + $HEIGHT
_WinAPI_SetWindowPos($MouseGui, 0, $LEFT, $TOP, $LEFT + $W, $TOP + $H, 0)
;Sleep(20) 自删
Local $hREG1 = _WinAPI_CreateRectRgn(0, 0, $W, $H)
Local $hREG2 = _WinAPI_CreateRectRgn($BORDER_LF_RI_SIZE, $BORDER_TO_BO_SIZE, $BORDER_LF_RI_SIZE + $WIDTH, $BORDER_TO_BO_SIZE + $HEIGHT)
Local $hREG3 = _WinAPI_CreateRectRgn(0, 0, 0, 0)
_WinAPI_CombineRgn($hREG3, $hREG1, $hREG2, $RGN_DIFF)
_WinAPI_DeleteObject($hREG1)
_WinAPI_DeleteObject($hREG2)
_WinAPI_SetWindowRgn($MouseGui, $hREG3)
_WinAPI_DeleteObject($hREG3)
GUISetState(@SW_SHOW, $MouseGui)
EndFunc
#CS
$A=WinGetHandle("控制面板")
WinActivate($A)
WinMove($A,"",100,100)
While 1
Local $ls=MouseGetPos()
CW($LS[0]&"+"&$LS[1])
WEnd
#CE
代码如何修改才能在WIN10下正常,请明白指点下,谢谢