示例#1
0
文件: Form.cs 项目: mind0n/hive
        void RestrictedProcessNcActivate() {
            Debug.Assert(IsRestrictedWindow, "This should only be called for restricted windows");

            // Ignore if tearing down...
            //
            if (IsDisposed || Disposing) {
                return;
            }

            // Note that this.Handle does not get called when the handle hasn't been created yet (See VSWhidbey 264275 & 264291)
            //
            SecurityToolTip secTip = (SecurityToolTip)Properties.GetObject(PropSecurityTip);
            if (secTip == null) {
                if (IsHandleCreated && UnsafeNativeMethods.GetForegroundWindow() == this.Handle) {
                    secTip = new SecurityToolTip(this);
                    Properties.SetObject(PropSecurityTip, secTip);
                }
            }
            else if (!IsHandleCreated || UnsafeNativeMethods.GetForegroundWindow() != this.Handle)
            {
                secTip.Pop(false /*noLongerFirst*/);
            }
            else
            {
                secTip.Show();
            }
        }
示例#2
0
文件: Form.cs 项目: mind0n/hive
 internal ToolTipNativeWindow(SecurityToolTip control) {
     this.control = control;
 }
 private void RestrictedProcessNcActivate()
 {
     if (!base.IsDisposed && !base.Disposing)
     {
         SecurityToolTip tip = (SecurityToolTip) base.Properties.GetObject(PropSecurityTip);
         if (tip == null)
         {
             if (base.IsHandleCreated && (System.Windows.Forms.UnsafeNativeMethods.GetForegroundWindow() == base.Handle))
             {
                 tip = new SecurityToolTip(this);
                 base.Properties.SetObject(PropSecurityTip, tip);
             }
         }
         else if (!base.IsHandleCreated || (System.Windows.Forms.UnsafeNativeMethods.GetForegroundWindow() != base.Handle))
         {
             tip.Pop(false);
         }
         else
         {
             tip.Show();
         }
     }
 }