matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [Help] FTP upload
Here is code I use for Screenshot Sender 4
code: function OnWndFTPUploadEvent_CtrlClicked(Wnd, sControlId){
if(sControlId == 'BtnTest'){
var tmpWnd = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndFTPUploadTest", 67, 174, true);
Wnd.SendControlMessage('BtnTest', WM_ENABLE, 0,0);
var hConnection;
var hOpen;
var pFlag;
if (PassiveConnection == true){ pFlag = 134217728; }
else{ pFlag = 0; }
hOpen = Interop.Call('wininet.dll', 'InternetOpenW', 'SS4 FTP Upload', 0, '', '', 0)
hConnection = Interop.Call('wininet.dll', 'InternetConnectW', hOpen,
Wnd.GetControlText('txtServer'),
eval(Wnd.GetControlText('txtPort')),
Wnd.GetControlText('txtLogin'),
Wnd.GetControlText('txtPassword'),
1,
pFlag,
0);
var pParent = Interop.Call('user32', 'GetAncestor', tmpWnd.Handle, 2)
Interop.Call('user32', 'ShowWindow', pParent, 0);
if (hConnection > 0){
Interop.Call('user32', 'MessageBoxW', 0, 'Connection to server successful', 'Successful', 64);
}
else{
Interop.Call('user32', 'MessageBoxW', 0, 'Connection to server unsuccessful', 'Unsuccessful', 64);
}
Interop.Call('user32', 'ShowWindow', pParent, 1);
Interop.Call('wininet.dll', 'InternetCloseHandle', hConnection);
Interop.Call('wininet.dll', 'InternetCloseHandle', hOpen);
tmpWnd.Close(1);
Wnd.SendControlMessage('BtnTest', WM_ENABLE, 1,0);
}
}
This post was edited on 07-09-2006 at 04:34 PM by matty.
|
|