Jump to content


Photo

Visually obscuring a control of another application


  • Please log in to reply
9 replies to this topic

#1 drmartell

drmartell
  • Members
  • 32 posts

Posted 04 March 2012 - 07:06 PM

I do screen sharing (GoToMeeting) as part of my daily work, and there are times that I need to demonstrate an application where sensitive account numbers are visible. These account numbers appear in a dropdown control.

Is there a way to visually hide or blur the control to protect the account numbers from view?

thanks.

#2 maul.esel

maul.esel
  • Members
  • 790 posts

Posted 04 March 2012 - 07:12 PM

Should be possible. I'd go for
1. Get control position (ControlGetPos)
2. Create a GUI (e.g. black & borderless) and put it before (should be AlwaysOnTop)

#3 drmartell

drmartell
  • Members
  • 32 posts

Posted 04 March 2012 - 08:58 PM

ok, is there a way to keep it on top of a window that is already set as AlwaysOnTop by the other application?

#4 maul.esel

maul.esel
  • Members
  • 790 posts

Posted 04 March 2012 - 09:19 PM

Good question. There should actually be one, however I can't name it.
Might be of interest: Hooking the shell. Not tested though :?

Another idea: just color the pixels.

#5 Odlanir

Odlanir
  • Members
  • 754 posts

Posted 05 March 2012 - 08:28 AM

Another idea: SplashImage.
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 lain

lain
  • Members
  • 183 posts

Posted 05 March 2012 - 11:35 AM

You can Bitblt an image/drawing directly on the application GUI so then no need for an alwaysontop docked window.

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 drmartell

drmartell
  • Members
  • 32 posts

Posted 08 March 2012 - 12:45 PM

thanks for the suggestions everyone, very helpful.

#8 patgenn

patgenn
  • Guests

Posted 08 March 2012 - 01:52 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.

#9 Guests

  • Guests

Posted 08 March 2012 - 02:12 PM

Dock it <!-- m -->http://www.autohotke... ... light=dock<!-- m -->

#10 tic

tic
  • Members
  • 1902 posts

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?