What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help] FTP upload

[Help] FTP upload
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
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.
07-09-2006 04:32 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Help] FTP upload - by rob_botch on 07-09-2006 at 08:50 AM
RE: [Help] FTP upload - by matty on 07-09-2006 at 04:32 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On