Visually obscuring a control of another application
#1
Posted 04 March 2012 - 07:06 PM
Is there a way to visually hide or blur the control to protect the account numbers from view?
thanks.
#2
Posted 04 March 2012 - 07:12 PM
1. Get control position (ControlGetPos)
2. Create a GUI (e.g. black & borderless) and put it before (should be AlwaysOnTop)
#3
Posted 04 March 2012 - 08:58 PM
#4
Posted 04 March 2012 - 09:19 PM
Might be of interest: Hooking the shell. Not tested though :?
Another idea: just color the pixels.
#5
Posted 05 March 2012 - 08:28 AM
This will create 4 gray rectangles on top of your screen obscuring everything underneath.
Splashimage, 1:, B W200 H200 CWC0C0C0 X0010 y300 Splashimage, 2:, B W200 H200 CWC0C0C0 X0400 Y400 Splashimage, 3:, B W100 H050 CWC0C0C0 X0600 Y100 Splashimage, 4:, B W100 H050 CWC0C0C0 X1000 Y010
#6
Posted 05 March 2012 - 11:35 AM
Example puts a black rectangle on notepad.
#persistent
onexit exit_
settitlematchmode 2
;Include gdip.ahk ;http://www.autohotkey.com/forum/topic32238.html Thanks to Tic!!
IfWinNotExist, Notepad
{
msgbox window not found
exitapp
}
winget,hwnd,ID,Notepad
if (hwnd=0)
{
msgbox error in handle
exitapp
}
w:=100 ;dimenasions and position of coverrectangle
h:=100
x:=50
y:=50
if !(pToken:=Gdip_Startup())
{
msgbox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
hdc_WINDOW := DllCall("GetDC", UInt, hwnd)
hbm := CreateDIBSection(w, h)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
pGraphics:= Gdip_GraphicsFromHDC(hdc)
pBlack:= Gdip_BrushCreateSolid(0xff000000)
Gdip_FillRectangle(pGraphics,pBlack,0,0,w,h)
Gdip_DeleteBrush(pBrush)
SetTimer,DRAW_SCENE, 20
return
DRAW_SCENE:
BitBlt(hdc_WINDOW,x,y, w,h, hdc,0,0)
return
exit_:
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
DeleteDC(hdc_window)
Gdip_DeleteGraphics(pGraphics)
Gdip_Shutdown(pToken)
exitapp
#7
Posted 08 March 2012 - 12:45 PM
#8
patgenn
Posted 08 March 2012 - 01:52 PM
In other words, suppose the rectangle is over a 3rd party application form, and I hold down the form to drag it to another area of the screen.
How can I get the rectangle to move along with the form perfectly to obscure the data if the form is dragged? It would look like it was embedded on the form, but not part of the form.
#9
Guests
#10
Posted 08 March 2012 - 04:17 PM
I am curious as to how this would work if I were to draw a rectangle on top of a form to obscure something, but would also be able to move in unison to the form moving?
In other words, suppose the rectangle is over a 3rd party application form, and I hold down the form to drag it to another area of the screen.
How can I get the rectangle to move along with the form perfectly to obscure the data if the form is dragged? It would look like it was embedded on the form, but not part of the form.
What's wrong with yui's example?




