bobbysdog
asked on
Need way to accept JPG files when dragging from Google Chrome to Delphi Form
Hi thanks for reading.
I have my delphi app on the left, and Google's Chrome browser on the right.
I simply need a program that, when i drag a JPG file from Google Chrome to my Delphi Form, I just want to save it in the C drive.
I can't seem to find out how to "accept files" from Google Chrome though.
I tried this method but with no luck
http://www.swissdelphicenter.ch/en/showcode.php?id=493
Anyone got any ideas?
Thanks!
I have my delphi app on the left, and Google's Chrome browser on the right.
I simply need a program that, when i drag a JPG file from Google Chrome to my Delphi Form, I just want to save it in the C drive.
I can't seem to find out how to "accept files" from Google Chrome though.
I tried this method but with no luck
http://www.swissdelphicenter.ch/en/showcode.php?id=493
Anyone got any ideas?
Thanks!
Changes are here; So, you want to save the image to C drive?
procedure TForm1.WMDROPFILES(var Msg: TMessage);
var
c,i, nCount,iSize : integer;
acFileName : Pchar;
f:boolean;
fn:string;
begin
nCount := DragQueryFile( msg.WParam,
$FFFFFFFF,
acFileName,
255 );
for i := 0 to nCount-1 do
begin
iSize := DragQueryFile(Msg.wParam, i, nil, 0) + 1;
acFileName := StrAlloc(iSize);
DragQueryFile( msg.WParam, i,acFileName, isize );
if FileExists(acFileName) then
begin
fn:=Pchar(ExtractFilename(acFilename));
AddFile(Fn);
CopyFile( acFilename, Pchar('c:\' + fn), false); //SAVING FILE STARTS HERE
end;
DragFinish( msg.WParam );
end;
end;
ASKER
Geez thanks Systan!!!
Freakin genius bits of code there.
It works awesome when i use mozilla and Internet Explorer.
The only thing is, it doesnt accept Images from Google Chrome
; (
Tears!
: )
I wonder why chrome is so weird compared to the others...
Freakin genius bits of code there.
It works awesome when i use mozilla and Internet Explorer.
The only thing is, it doesnt accept Images from Google Chrome
; (
Tears!
: )
I wonder why chrome is so weird compared to the others...
Ok;
Google Chrome does not keep files in windows temporary system folder, it keeps files on thy own ways.
You can find it on;
Application Data of the default user logged in.
Google Chrome does not keep files in windows temporary system folder, it keeps files on thy own ways.
You can find it on;
Application Data of the default user logged in.
ASKER
Thanks so much.
It appears the problem is, i can't even get the program to 'accept' files from google chrome...
i uploaded the above code in a delphi program here
http://www.mediafire.com/?m4njdxy0hoylbck
p.s. i should also note that, when you drag a picture file (in IE or Mozilla) that is wrapped in an A TAG (e.g. when the picture is also a link), then it won't accept files.
Any help anyone can give is so much appreciated!
much thanks!
It appears the problem is, i can't even get the program to 'accept' files from google chrome...
i uploaded the above code in a delphi program here
http://www.mediafire.com/?m4njdxy0hoylbck
p.s. i should also note that, when you drag a picture file (in IE or Mozilla) that is wrapped in an A TAG (e.g. when the picture is also a link), then it won't accept files.
Any help anyone can give is so much appreciated!
much thanks!
As I told you, you can't get accept files from Google chrome because it stores files in different ways.
Instead storing to windows temp files, it stores to Document and Settings\Logged-in User\Application Data\Google\Chrome\
You can't really drag and drop images from Google Chrome to any location, as I know?, that is there
design.
If you really want to get the file-name from Google Chrome?, Click Copy Image, then paste it on your Application that do the imaging. But if you really want to drop it?, detect the browser if it is Google chrome or not, then if it is, automate the procedure to paste filename to the BOX.
That's the list that I could help, Open a new question for detect web browser or;
just visit this link;
https://www.experts-exchange.com/questions/26553357/How-do-I-get-the-URL-and-change-the-active-tab-in-Google-Chrome.html
You could also ask; automate a copy paste filename to the BOX, if possible.
Good Luck
Instead storing to windows temp files, it stores to Document and Settings\Logged-in User\Application Data\Google\Chrome\
You can't really drag and drop images from Google Chrome to any location, as I know?, that is there
design.
If you really want to get the file-name from Google Chrome?, Click Copy Image, then paste it on your Application that do the imaging. But if you really want to drop it?, detect the browser if it is Google chrome or not, then if it is, automate the procedure to paste filename to the BOX.
That's the list that I could help, Open a new question for detect web browser or;
just visit this link;
https://www.experts-exchange.com/questions/26553357/How-do-I-get-the-URL-and-change-the-active-tab-in-Google-Chrome.html
You could also ask; automate a copy paste filename to the BOX, if possible.
Good Luck
ASKER
oh i think i see
>> "You can't really drag and drop images from Google Chrome to any location"
oh so eitherway, its not possible to receive files from Google Chrome?
hmm
what a bummer.
The windows desktop receives jpgs from google chrome. Is there now way to use that method?
but yeah maybe its not possible
photoshop for example receives files from IE and Mozilla but not chrome...
>> "You can't really drag and drop images from Google Chrome to any location"
oh so eitherway, its not possible to receive files from Google Chrome?
hmm
what a bummer.
The windows desktop receives jpgs from google chrome. Is there now way to use that method?
but yeah maybe its not possible
photoshop for example receives files from IE and Mozilla but not chrome...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I have resolved the problem, it is possible.
ASKER
oh wait..
it IS possible now?
what was the solution...?
Thanks!
it IS possible now?
what was the solution...?
Thanks!
The answer;
http://melander.dk/
Thanks
Actually I'm not sure, but your the one who want's it, please try it.
http://melander.dk/
Thanks
Actually I'm not sure, but your the one who want's it, please try it.
Open in new window