Windows 10: Lock Screen Images

Post Reply
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Windows 10: Lock Screen Images

Post 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.
Regards

G. N. Rao.
Hyderabad, India
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: Windows 10: Lock Screen Images

Post 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
 
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Windows 10: Lock Screen Images

Post by nageswaragunupudi »

Thanks. We'll check this.
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Windows 10: Lock Screen Images

Post 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
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Windows 10: Lock Screen Images

Post 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
Last edited by Silvio.Falconi on Thu Apr 30, 2020 8:12 pm, edited 1 time in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Windows 10: Lock Screen Images

Post 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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: Windows 10: Lock Screen Images

Post 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
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: Windows 10: Lock Screen Images

Post by richard-service »

Hi RAO,

Now is work for win10 1909 18363.815
Regards,

Richard

Harbour 3.2.0dev (r1904111533)/xHarbour 1.2.3 Intl. (SimpLex) (Build 20180818) => Borland C++ v7.4
xHarbour 0.99.71 (SimpLex) => Borland C++ v5.5
MySQL v5.7 /ADS v12
Harbour 3.2.0dev (r1603181642) => Borland C++ v7.4 64bit
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Windows 10: Lock Screen Images

Post by nageswaragunupudi »

Mr. Hakan

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

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Windows 10: Lock Screen Images

Post 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
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Mulyadi
Posts: 77
Joined: Mon Apr 18, 2011 2:32 am

Re: Windows 10: Lock Screen Images

Post by Mulyadi »

Mr. Rao

Very nice.
but restore image does not work in MDI mode
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Windows 10: Lock Screen Images

Post by Silvio.Falconi »

someone explain me what it is ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply