Skip to content

Instantly share code, notes, and snippets.

@divinity76
Created May 3, 2020 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divinity76/dd4d883f4a263a11997cdbcd7af8fcb4 to your computer and use it in GitHub Desktop.
Save divinity76/dd4d883f4a263a11997cdbcd7af8fcb4 to your computer and use it in GitHub Desktop.
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <WinAPI.au3>
#include <WinAPISys.au3>
#include <WinAPIvkeysConstants.au3>
Func ExitFunc()
Exit(0);
EndFunc
HotKeySet("l","ExitFunc");llllllllllllll
Func DoTheGuiThing(const $topPosition = 0, const $leftPosition = 0)
Local Static $hGUIChild = 0;
Local Static $hGUIMain = 0;
if($hGUIChild <> 0) Then
GUIDelete($hGUIChild);
$hGUIChild=0;
EndIf
if($hGUIMain <> 0) Then
GUIDelete($hGUIMain);
$hGUIMain=0;
EndIf; X
Local $iSize = 21
Local $iColor = $COLOR_RED; X
$hGUIMain = GUICreate("")
;Local $top = Random(-1,100);
;$top=1000;
$hGUIChild = GUICreate("", $iSize, $iSize, $leftPosition, $topPosition, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED, $WS_EX_TRANSPARENT), $hGUIMain)
GUISetBkColor($COLOR_BLACK)
GUICtrlCreateLabel("", 0, Int($iSize / 2), $iSize, 1)
GUICtrlSetBkColor(-1, $iColor)
GUICtrlCreateLabel("", Int($iSize / 2), 0, 1, $iSize); ; X (right above)
GUICtrlSetBkColor(-1, $iColor)
_WinAPI_SetLayeredWindowAttributes($hGUIChild, $COLOR_BLACK)
GUISetState(@SW_SHOWNOACTIVATE, $hGUIChild)
( _WinAPI_SetWindowPos($hGUIChild, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOSENDCHANGING)) )
EndFunc
Local $i = 0;
Sleep(5000);
While 1
DoTheGuiThing(373,501);
Sleep(10*1000);
;$i = $i + 1;
;ConsoleWrite("left: " & $i & @CrLf );
;Sleep(100);
; ConsoleWrite("top: " & $i & @CrLf );
;DoTheGuiThing($i);
; Sleep(1);
WEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment