Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Drag and Drop
I have a registered copy of Winbatch and I have downloaded the winsock extender. I am creating this program on Win95.
Can this be done? How do I determine if something has been dropped onto the icon? What other commands do I have to know in WinBatch?
If you have the compiler, you just compile an exe file and put the exe on the desktop. The name of the file that is dragged onto the WB EXE will show up as the variable "param1". (See the WinBatch.hlp file (NOT the WIL help file) to read more about command line parameters.) You'll test for the status of param0, and if it is greater than 0, then you'll do something.
If param0>0 then ...If the icon was double clicked (rather than the file being dragged and dropped onto it), then param0 (which is the number of parameters) would be zero.
To keep the application from failing when double-clicked without a file dragged to it, (param0 would in this case equal 0), add the following code:
If Param0==0 then Param1=""
The Internet WinSock extender ought to be able to do the entire FTP transfer part of your procedure.
So step 1 is to make a WBT script that prompts you for a file name and FTPs it to your printer. Here's what you gotta do ...
;Duper Super Auto-Ftp program. ;Add this to your FileMenu. When you want to ;FTP the file someplace, just right-click on the file menu ;and select FTP ;FTP the file someplace ;Initialize these variables accordingly host="ftp.windowware.com" userid="xxxxx pswd="yyyyyyy" acct="" destdirectory="/www/wwwftp/wbxx/" dafile=CurrFilePath() dafile=FileNameLong(param1) dabasicfile=FileRoot(dafile) x=FileExtension(dafile) if x!="" then dabasicfile=strcat(dabasicfile,".",x) daremotefile=strcat(destdirectory,dabasicfile) AddExtender("wwwsk34I.dll") ; this is the WinSock extender hSession=FtpOpen(host,userid,pswd,acct,1) if !IsNumber(hSession) Message("FTP Open Error",hSession) exit endif rs=FtpChDir(hSession,destdirectory) if rs!="" Message("FTP ChDir Error",rs) exit endif rs=Ftpput(hSession, dafile, daremotefile, "B") FtpClose(hSession) if rs!="" Message("FtpPut Error",rs) else Display(1,"Ftp Success",daremotefile) endif
Article ID: W13444
Filename: How to Drag and Drop a file onto a Icon.txt
File Created: 2006:08:24:12:11:32
Last Updated: 2006:08:24:12:11:32