Page 1 of 1

Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 2:56 pm
by nageswaragunupudi
In case you are using Windows 10, we suggest trying out this small program on your Windows 10 PC for diversion:

fwh\samples\lockscrn.prg:

Code: Select all

/*
* Program to view and save Windows 10 LockScreen Images
*
*/

#include "fivewin.ch"

//----------------------------------------------------------------------------//

function Main()

   local cPath := GETENV( "userprofile" ) + "\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\"
   local aImages  := {}
   local oWnd, oBar, oImage, cSave, nImages, n := 1

   AEval( DIRECTORY( cPath + "*.*", "H" ), { |a| If( a[ 2 ] < 200000,, ( a[ 1 ] := cPath + a[ 1 ], AAdd( aImages, a ) ) ) } )
   ASort( aImages,,,{ |x,y| x[ 2 ] > y[ 2 ] } )
   nImages  := Len( aImages )

   DEFINE WINDOW oWnd STYLE WS_POPUP + WS_MAXIMIZE

   DEFINE BUTTONBAR oBar SIZE 32,32 LEFT
   oBar:SetColor( CLR_BLACK, CLR_BLACK )

   DEFINE BUTTON RESOURCE 0xE112 OF oBar CENTER ACTION ( If( --n < 1, n := nImages, ), oWnd:Update() )
   DEFINE BUTTON RESOURCE 0xE111 OF oBar CENTER ACTION ( n := ( n % nImages ) + 1, oWnd:Update() )
   DEFINE BUTTON RESOURCE 0xE105 OF oBar CENTER ACTION ( ;
      If( !Empty( cSave := cGetFile( "Jpg file(*.jpg)|*.jpg|", ;
      "Select File to Save", CurDir(), .t. ) ), ;
      HB_MEMOWRIT( cFileSetExt( cSave, "jpg" ), MEMOREAD( aImages[ n, 1 ] ) ), MsgInfo( "Not selected" ) ) )
   DEFINE BUTTON RESOURCE FWBitmap( "exit2" ) OF oBar CENTER ACTION oWnd:End()

   oBar:Float()

   @ 0,0 XIMAGE oImage SOURCE MEMOREAD( aImages[ n, 1 ] ) SIZE 0, 0 OF oWnd NOBORDER UPDATE
   oImage:SetColor( CLR_WHITE, CLR_BLACK )
   oImage:bLClicked := { || n := ( n % nImages ) + 1, oWnd:Update() }
   oImage:bRClicked := { || If( MsgYesNo( "Exit program?" ), oWnd:End(), ) }

   oWnd:oClient := oImage

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

//----------------------------------------------------------------------------//
We would be glad to have your comments.

Re: Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 3:09 pm
by Horizon
Hi Mr. Rao,

with buildh32 this gives an error.

Code: Select all

Application
===========
   Path and name: C:\fwh\samples\testrao.exe (32 bits)
   Size: 4,219,392 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 20.03
   C compiler version: Microsoft Visual C++ 19.20.27508 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 04/30/20, 18:07:11
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 0
     [   2] = N   1

Stack Calls
===========
   Called from: testrao.prg => (b)MAIN( 37 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:DEFAULT( 216 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:NEW( 161 )
   Called from: testrao.prg => MAIN( 37 )

System
======
   CPU type: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz 2208 Mhz
   Hardware memory: 16268 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 3
      1 , C:\fwh\samples\testrao.exe                                                                          
      2 G, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.778_none_5f5ee11d821bf28 
      3 LOGI_RAWINPUT_WND,                                                                                                     

Variables in use
================
   Procedure     Type   Value
   ==========================
   (b)MAIN
     Param   1:    O    Class: ERROR
   TXIMAGE:DEFAULT
     Local   1:    S    
     Local   2:    U    
     Local   3:    A    Len:    0
     Local   4:    N    1
     Local   5:    U    
     Local   6:    U    
   TXIMAGE:NEW
     Local   1:    O    Class: TXIMAGE
     Local   2:    S    
     Local   3:    O    Class: TXIMAGE
   MAIN
     Param   1:    N    0
     Param   2:    N    0
     Param   3:    N    100
     Param   4:    N    100
     Param   5:    B    {|| ... }
     Param   6:    O    Class: TWINDOW
     Param   7:    L    .T.
     Param   8:    L    .T.

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TWINDOW
     5 TBRUSH
     6 TFONT
     7 TREG32
     8 TCONTROL
     9 TBAR
    10 TRECT
    11 TBTNBMP
    12 TMENU
    13 TMENUITEM
    14 TXIMAGE
    15 TCLIPBOARD
    16 TSTRUCT

Memory Analysis
===============
      583 Static variables

   Dynamic memory consume:
      Actual  Value:     917504 bytes
      Highest Value:     917504 bytes
 

Re: Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 4:01 pm
by nageswaragunupudi
Thanks. We'll check this.

Re: Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 4:57 pm
by ukoenig
NO errors

the results on image change

Image

Full size on desktop - mouseclick
I noticed a random size-change between full and partly-screensize :?:

Image

regards
Uwe :D

Re: Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 8:06 pm
by Silvio.Falconi
why here the test make error ?

Called from: test.prg => (b)MAIN( 37 )
Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:DEFAULT( 216 )
Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:NEW( 161 )
Called from: test.prg => MAIN( 37 )

sorry on w7 but on win 10 is ok

Re: Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 8:12 pm
by Silvio.Falconi
Horizon wrote:Hi Mr. Rao,

with buildh32 this gives an error.

Code: Select all

Application
===========
   Path and name: C:\fwh\samples\testrao.exe (32 bits)
   Size: 4,219,392 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 20.03
   C compiler version: Microsoft Visual C++ 19.20.27508 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 04/30/20, 18:07:11
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 0
     [   2] = N   1

Stack Calls
===========
   Called from: testrao.prg => (b)MAIN( 37 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:DEFAULT( 216 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:NEW( 161 )
   Called from: testrao.prg => MAIN( 37 )

System
======
   CPU type: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz 2208 Mhz
   Hardware memory: 16268 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 3
      1 , C:\fwh\samples\testrao.exe                                                                          
      2 G, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.778_none_5f5ee11d821bf28 
      3 LOGI_RAWINPUT_WND,                                                                                                     

Variables in use
================
   Procedure     Type   Value
   ==========================
   (b)MAIN
     Param   1:    O    Class: ERROR
   TXIMAGE:DEFAULT
     Local   1:    S    
     Local   2:    U    
     Local   3:    A    Len:    0
     Local   4:    N    1
     Local   5:    U    
     Local   6:    U    
   TXIMAGE:NEW
     Local   1:    O    Class: TXIMAGE
     Local   2:    S    
     Local   3:    O    Class: TXIMAGE
   MAIN
     Param   1:    N    0
     Param   2:    N    0
     Param   3:    N    100
     Param   4:    N    100
     Param   5:    B    {|| ... }
     Param   6:    O    Class: TWINDOW
     Param   7:    L    .T.
     Param   8:    L    .T.

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TWINDOW
     5 TBRUSH
     6 TFONT
     7 TREG32
     8 TCONTROL
     9 TBAR
    10 TRECT
    11 TBTNBMP
    12 TMENU
    13 TMENUITEM
    14 TXIMAGE
    15 TCLIPBOARD
    16 TSTRUCT

Memory Analysis
===============
      583 Static variables

   Dynamic memory consume:
      Actual  Value:     917504 bytes
      Highest Value:     917504 bytes
 
you're using Windows Seven

Re: Windows 10: Lock Screen Images

Posted: Thu Apr 30, 2020 9:25 pm
by Horizon
Silvio.Falconi wrote:
Horizon wrote:Hi Mr. Rao,

with buildh32 this gives an error.

Code: Select all

Application
===========
   Path and name: C:\fwh\samples\testrao.exe (32 bits)
   Size: 4,219,392 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 20.03
   C compiler version: Microsoft Visual C++ 19.20.27508 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 04/30/20, 18:07:11
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 0
     [   2] = N   1

Stack Calls
===========
   Called from: testrao.prg => (b)MAIN( 37 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:DEFAULT( 216 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:NEW( 161 )
   Called from: testrao.prg => MAIN( 37 )

System
======
   CPU type: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz 2208 Mhz
   Hardware memory: 16268 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 3
      1 , C:\fwh\samples\testrao.exe                                                                          
      2 G, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.778_none_5f5ee11d821bf28 
      3 LOGI_RAWINPUT_WND,                                                                                                     

Variables in use
================
   Procedure     Type   Value
   ==========================
   (b)MAIN
     Param   1:    O    Class: ERROR
   TXIMAGE:DEFAULT
     Local   1:    S    
     Local   2:    U    
     Local   3:    A    Len:    0
     Local   4:    N    1
     Local   5:    U    
     Local   6:    U    
   TXIMAGE:NEW
     Local   1:    O    Class: TXIMAGE
     Local   2:    S    
     Local   3:    O    Class: TXIMAGE
   MAIN
     Param   1:    N    0
     Param   2:    N    0
     Param   3:    N    100
     Param   4:    N    100
     Param   5:    B    {|| ... }
     Param   6:    O    Class: TWINDOW
     Param   7:    L    .T.
     Param   8:    L    .T.

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TWINDOW
     5 TBRUSH
     6 TFONT
     7 TREG32
     8 TCONTROL
     9 TBAR
    10 TRECT
    11 TBTNBMP
    12 TMENU
    13 TMENUITEM
    14 TXIMAGE
    15 TCLIPBOARD
    16 TSTRUCT

Memory Analysis
===============
      583 Static variables

   Dynamic memory consume:
      Actual  Value:     917504 bytes
      Highest Value:     917504 bytes
 
you're using Windows Seven
No, W10 build 1909 - 18363.778

Re: Windows 10: Lock Screen Images

Posted: Fri May 01, 2020 7:48 am
by richard-service
Hi RAO,

Now is work for win10 1909 18363.815

Re: Windows 10: Lock Screen Images

Posted: Fri May 01, 2020 8:02 am
by nageswaragunupudi
Mr. Hakan

I modified the program.
Can you copy the modified program and try again?

Re: Windows 10: Lock Screen Images

Posted: Fri May 01, 2020 8:18 am
by Silvio.Falconi
Horizon wrote:
Silvio.Falconi wrote:
Horizon wrote:Hi Mr. Rao,

with buildh32 this gives an error.

Code: Select all

Application
===========
   Path and name: C:\fwh\samples\testrao.exe (32 bits)
   Size: 4,219,392 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 20.03
   C compiler version: Microsoft Visual C++ 19.20.27508 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 04/30/20, 18:07:11
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 0
     [   2] = N   1

Stack Calls
===========
   Called from: testrao.prg => (b)MAIN( 37 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:DEFAULT( 216 )
   Called from: .\source\classes\XIMAGE.PRG => TXIMAGE:NEW( 161 )
   Called from: testrao.prg => MAIN( 37 )

System
======
   CPU type: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz 2208 Mhz
   Hardware memory: 16268 megs

   Free System resources: 90 %
        GDI    resources: 90 %
        User   resources: 90 %

   Windows total applications running: 3
      1 , C:\fwh\samples\testrao.exe                                                                          
      2 G, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.778_none_5f5ee11d821bf28 
      3 LOGI_RAWINPUT_WND,                                                                                                     

Variables in use
================
   Procedure     Type   Value
   ==========================
   (b)MAIN
     Param   1:    O    Class: ERROR
   TXIMAGE:DEFAULT
     Local   1:    S    
     Local   2:    U    
     Local   3:    A    Len:    0
     Local   4:    N    1
     Local   5:    U    
     Local   6:    U    
   TXIMAGE:NEW
     Local   1:    O    Class: TXIMAGE
     Local   2:    S    
     Local   3:    O    Class: TXIMAGE
   MAIN
     Param   1:    N    0
     Param   2:    N    0
     Param   3:    N    100
     Param   4:    N    100
     Param   5:    B    {|| ... }
     Param   6:    O    Class: TWINDOW
     Param   7:    L    .T.
     Param   8:    L    .T.

Linked RDDs
===========
   DBF
   DBFFPT
   DBFBLOB
   DBFNTX

DataBases in use
================

Classes in use:
===============
     1 ERROR
     2 HBCLASS
     3 HBOBJECT
     4 TWINDOW
     5 TBRUSH
     6 TFONT
     7 TREG32
     8 TCONTROL
     9 TBAR
    10 TRECT
    11 TBTNBMP
    12 TMENU
    13 TMENUITEM
    14 TXIMAGE
    15 TCLIPBOARD
    16 TSTRUCT

Memory Analysis
===============
      583 Static variables

   Dynamic memory consume:
      Actual  Value:     917504 bytes
      Highest Value:     917504 bytes
 
you're using Windows Seven
No, W10 build 1909 - 18363.778
No Mr. The error log file reporter the

Windows version: 6.2, Build 9200

It Is Windows Seven edition

Re: Windows 10: Lock Screen Images

Posted: Fri May 01, 2020 3:29 pm
by Mulyadi
Mr. Rao

Very nice.
but restore image does not work in MDI mode

Re: Windows 10: Lock Screen Images

Posted: Fri May 01, 2020 9:01 pm
by Silvio.Falconi
someone explain me what it is ?