Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Windows Form Freezes launching from script

$
0
0
Hi,

I am launching windows form from script in event handler, form launched successfully and unable interact with form and form freezes.
            FileSystemWatcher _fileWatcher = new System.IO.FileSystemWatcher();
            vde.AddHostObject("_fileWatcher", _fileWatcher);        
            
            _fileWatcher.Path = "C:\\Users\\praveen\\Desktop";
            _fileWatcher.Filter = "*.*";
            _fileWatcher.NotifyFilter = System.IO.NotifyFilters.Attributes |
                                                     System.IO.NotifyFilters.CreationTime |
                                                     System.IO.NotifyFilters.DirectoryName |
                                                     System.IO.NotifyFilters.FileName |
                                                     System.IO.NotifyFilters.LastAccess |
                                                     System.IO.NotifyFilters.LastWrite |
                                                     System.IO.NotifyFilters.Security |
                                                     System.IO.NotifyFilters.Size;
            _fileWatcher.EnableRaisingEvents = true;
            _fileWatcher.IncludeSubdirectories = true;
Script
var form=new WinForms.System.Windows.Forms.Form();

var delconncect=_fileWatcher.Created.connect(function(obj,e){
     form.Show();   
});

var desconncect=_fileWatcher.Deleted.connect(function(obj,e){
    form.Show();        
});
form does not freeze if we launch without event handler.

Thanks and Regards
Praveen Kumar

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images