Page 1 of 1

Inactive Windows

Posted: Sun Aug 16, 2020 4:00 am
by AUGE_OHR
hi,

when have many Window it confuse me which is active ... so i try some visual Effect :)

Code: Select all

   DEFINE WINDOW MYwin
   ...
      ON GOTFOCUS  WinTans(ThisWindow.Name,.T.) ;
      ON LOSTFOCUS WinTans(ThisWindow.Name,.F.) ;
Transparency.jpg
Transparency.jpg (375.67 KiB) Viewed 1966 times

Code: Select all

PROCEDURE WinTans(cForm,lOnOff)
LOCAL hWnd
LOCAL bError := ERRORBLOCK( { | oErr | BREAK( oErr ) } )
   DEFAULT lOnOff TO .F.
   IF !EMPTY(cForm)
      BEGIN SEQUENCE
         hWnd := GetFormHandle(cForm)
         IF lOnOff = .T.
            SetLayeredWindowAttributes (hWnd, 0, 255, LWA_ALPHA) // full visible
         ELSE
            SetLayeredWindowAttributes (hWnd, 0, 128, LWA_ALPHA) // half transparent
         ENDIF
      END SEQUENCE
      ERRORBLOCK( bError )
   ENDIF
RETURN
does it help User or does it make more confuse ... :?:

Re: Inactive Windows

Posted: Sun Aug 16, 2020 7:09 am
by serge_girard
Just installed and I will give a try!

Thanks! Serge

Re: Inactive Windows

Posted: Sun Aug 16, 2020 9:11 am
by serge_girard
Unstalled it because too confusing!

Serge

Re: Inactive Windows

Posted: Sun Aug 16, 2020 5:10 pm
by AUGE_OHR
hi,

i agree that this is not the normal Look.

i like transparency but not sure "how much" so i have enhance Setup.
Setup_Transparency.JPG
Setup_Transparency.JPG (13.21 KiB) Viewed 1904 times
Value can be from 0 (not visible) to 255 (full visible)

Re: Inactive Windows

Posted: Sun Aug 16, 2020 6:53 pm
by Red2
Hi Jimmy,

Thank you, I like your idea to roll this transparency action into a function.

I want to explore this direction myself. My window transparency needs, at this time, simple enough. Therefore, when opening and closing windows I merely include the following simple commands (window names hard coded). A function for this looks better.

I have settled on dimming to a value of 200.

Code: Select all

// nAlphaBlendis from: 0 (completely transparent) to 255 (opaque)
set window Main Transparent to 200	// When opening another window, i.e. on OnInit()
set window Main Transparent to 255	// When returning
Thanks again,
Red2

Re: Inactive Windows

Posted: Tue Aug 18, 2020 4:39 pm
by franco
I have Always created a program or function or procedure
open tables
define window
* *
* *
close tables
release window
I think less confusing