tom13 Posted April 6, 2009 Share Posted April 6, 2009 (edited) Hi there, I want to create a window that is transparent everywhere except for the borders. At the borders a 1 pixel red line should be shown. The window should always be on top. I want to do this to indicate a pixelchecksum area, so that people know in what box the pixelchecksum is made. Could anyone help me with creating such transparent window with red borders? Edited April 6, 2009 by tom13 Link to comment Share on other sites More sharing options...
tom13 Posted April 6, 2009 Author Share Posted April 6, 2009 I tried the following, but for some reason the line is disappearing after a few milliseconds even though it should last 5 seconds: #RequireAdmin #include <WindowsConstants.au3> #include <WinAPI.au3> ;create box Dim $hDC, $hPen, $obj_orig $color = 0xFF $width = @DesktopWidth $start_x = @DesktopWidth / 2 $start_y = @DesktopHeight / 2 $length = 20 $width = 2 $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop) $hPen = _WinAPI_CreatePen($PS_SOLID, $width, $color) $obj_orig = _WinAPI_SelectObject($hDC, $hPen) _WinAPI_DrawLine($hDC, $start_x - $length, $start_y, $start_x - 5, $start_y) ; horizontal left _WinAPI_MoveTo($hDC, $start_x, $start_y + $length) _WinAPI_LineTo($hDC, $start_x, $start_y + 5) Sleep(5000) ; show ; refresh desktop (clear drawing) _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN) ; clear resources _WinAPI_SelectObject($hDC, $obj_orig) _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDC) Link to comment Share on other sites More sharing options...
tom13 Posted April 6, 2009 Author Share Posted April 6, 2009 I apologize for bumping but isn't there anyone who knows more about what I'm trying to achieve? Thanks in advance. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now