DECLARE FUNCTION Setfocus LIB "user32" ALIAS "SetFocus"(hwnd AS LONG) AS LONG
DECLARE SUB ProcessKey(key, Sender AS QEDIT)
CREATE Form AS QFORM
CAPTION = "Copying a directory and its contents"
Width = 320
Height = 240
Center
CREATE Edit1 AS QEDIT
Text = "Enter path and name of old directory"
Left = 50
Top = 100
Width = 209
OnKeyPress = ProcessKey
END CREATE
CREATE Edit2 AS QEDIT
Text = "Enter path and name of new directory"
Left = 50
Top = 130
Width = 209
OnKeyPress = ProcessKey
END CREATE
CREATE Panel AS QPANEL
Left = 50
Top = 45
Width = 209
CAPTION = "Contents of old will be copied to the new"
END CREATE
SHOWMODAL
END CREATE
SUB ProcessKey(key, Sender AS QEDIT)
IF key = 13 THEN
SELECT CASE Sender.Handle
CASE Edit1.Handle
SetFocus(Edit2.Handle)
CASE Edit2.Handle
x = SHELL("c:\windows\command\xcopy " + Edit1.Text + "\ " + Edit2.Text + "\ /e",0)
Panel.CAPTION = "All contents copied to " + Edit2.Text
END SELECT
END IF
END SUB
|