I need to download pic's from a site. I don't have access to ftp, so I will loop all the pics into a browsers and need to hit CTRL-S + ENTER to download the pic.
since it will be lots of img. the window needs to close afther download, and the proces should go further.
In this sample, the loop will show the images, but I can't get the download the work automatic.
I don't know how I can execute a keyboard buffer when it is in the window of the picture.
Any Idea ?
- Code: Select all Expand view
#include "fivewin.ch"
#include "Hbgtinfo.ch"
function Main()
local oWnd, oImage, oBar
local aPics := { "","","" }
aPics[1] = "https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg"
aPics[2] = "http://cdn.history.com/sites/2/2015/04/hith-eiffel-tower-iStock_000016468972Large.jpg"
aPics[3] = "https://cdn.sportdirect.com/resizer/500x500/108104-8200-01.jpg"
DEFINE WINDOW oWnd TITLE "FWH : XIMAGE"
website (aPics)
ACTIVATE WINDOW oWnd CENTERED
return nil
function website(aPics)
//DEFINE CLIPBOARD oWinfax
//oWinfax:SetText( "Test" )
//oWinfax:SetText( VK_CONTROL+ASC("S")+VK_RETURN ) // CTRL + S and RETURN
//oWinfax:SetText( VK_CONTROL+VK_RETURN ) // CTRL + S and RETURN
//HB_GTINFO( HB_GTI_CLIPBOARDDATA, "Hello!" )
HB_GTINFO( HB_GTI_CLIPBOARDDATA, VK_CONTROL+ASC('S')+VK_RETURN )
for i = 1 to len(aPics)
cLink = "c:\program files\google\chrome\application\chrome.exe "+aPics[I]
//WaitRun( cLink ) // Program stops until end
WaitRun( cLink, .T. ) // Program stops until end
//WaitRun( cLink, 0 )
//__Keyboard(VK_CONTROL+ASC('S')+VK_RETURN)
//__Keyboard(chr(VK_CONTROL)+"S"+chr(VK_RETURN))
//__keyboard()
//__Keyboard(chr(VK_CONTROL)+"V")
//ShellExecute( 0, "open", oWinfax )
//ShellExecute( 0, "open", HB_GTINFO( HB_GTI_CLIPBOARDDATA, VK_CONTROL+ASC('S')+VK_RETURN ) )
//WaitRun( cLink, "READING FORUM PAGE", { || downloadpic() } )
//WaitRun( cLink, "READING FORUM PAGE", { || downloadpic() } )
//msgrun ( cLink )
//MsgRun( cLink, "READING FORUM PAGE", { || downloadpic() } )
//syswait(5)
next
return NIL