Files
harbour-core/contrib/hbwin/tests/shfileop.prg
Viktor Szakats 58faf91453 2016-01-14 19:17 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com)
* *
    % remove brandings and homepage [1] from copyright header. Pass 1 - using script.
      [1] nobody has access to it anymore AFAIK - and it's also just
          a redirect since long
    ! update url in copyright header
    ; this should make the diff between 3.4 and 3.2 easier to manage
2016-01-14 19:18:17 +01:00

44 lines
981 B
Plaintext

/*
*
* Copyright 2010 Viktor Szakats (vszakats.net/harbour)
*
*/
#require "hbwin"
#include "simpleio.ch"
PROCEDURE Main()
LOCAL a
LOCAL lAbort
LOCAL tmp
? "0x" + hb_NumToHex( win_SHFileOperation( NIL, WIN_FO_COPY, { __FILE__, "olesrv1.prg" }, { "testcopy1" }, ;
NIL, @lAbort, ;
NIL, "Harbour SHFile 1" ) )
? lAbort
hb_MemoWrit( "rename.txt", "hello1" )
hb_MemoWrit( "rename1.txt", "hello2" )
a := {}
? "0x" + hb_NumToHex( win_SHFileOperation( NIL, WIN_FO_RENAME, { "rename.txt" }, { "rename1.txt" }, ;
WIN_FOF_WANTMAPPINGHANDLE, @lAbort, ;
a, "Harbour SHFile 2" ) )
? lAbort
FOR EACH tmp IN a
? tmp[ 1 ], tmp[ 2 ]
FErase( tmp[ 1 ] )
FErase( tmp[ 2 ] )
NEXT
FErase( "rename1.txt" )
? "0x" + hb_NumToHex( win_SHFileOperation( NIL, WIN_FO_COPY, __FILE__ + Chr( 0 ) + "olesrv1.prg" + Chr( 0 ), "testcopy2", ;
NIL, @lAbort, ;
NIL, "Harbour SHFile 3" ) )
? lAbort
RETURN