private void ProfileDlg_FormClosing( object sender, FormClosingEventArgs e ) { lock( currentThreadLock ) { currentThreadLock.Aborted = true; } }