Inactive Windows

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Inactive Windows

Post 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 1970 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 ... :?:
have fun
Jimmy
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Inactive Windows

Post by serge_girard »

Just installed and I will give a try!

Thanks! Serge
There's nothing you can do that can't be done...
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Inactive Windows

Post by serge_girard »

Unstalled it because too confusing!

Serge
There's nothing you can do that can't be done...
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Inactive Windows

Post 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 1908 times
Value can be from 0 (not visible) to 255 (full visible)
have fun
Jimmy
Red2
Posts: 281
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Re: Inactive Windows

Post 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
franco
Posts: 877
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Inactive Windows

Post by franco »

I have Always created a program or function or procedure
open tables
define window
* *
* *
close tables
release window
I think less confusing
All The Best,
Franco
Canada
Post Reply