Ejemplo n.º 1
0
 /// <summary>
 /// Displays properties of a clicked object. Depending on which item
 /// was clicked, the automatic link resolution may take place.
 /// </summary>
 private void ShowPropertiesClick(object sender, RoutedEventArgs e)
 {
     try
     {
         var info = new API.ShellExecuteInfo
         {
             fMask = //need all them for Properties verb
                     API.SEIFlags.SEE_MASK_INVOKEIDLIST | API.SEIFlags.SEE_MASK_NOCLOSEPROCESS |
                     API.SEIFlags.SEE_MASK_FLAG_NO_UI | API.SEIFlags.SEE_MASK_NOASYNC,
             hwnd   = BtnStck.Instance.GetHandle(), //otherwise will be in background
             nShow  = API.SWCommands.HIDE,          //hides some other window, kind of worker one
             lpVerb = API.SEVerbs.Properties,
             lpFile = Args4PropsAndCont(Util.ExtractRelatedPowerItem(e), ((MenuItem)sender).Name)
         };
         var executer = new Util.ShellExecuteHelper(info); //Needed to be executed on STA htread
         if (!executer.ShellExecuteOnSTAThread())
         {
             throw new ExternalException(string.Format(
                                             Power8.Properties.Resources.Err_ShellExecExErrorFormatString, executer.ErrorCode, executer.ErrorText));
         }
     }
     catch (Exception ex)
     {
         Util.DispatchCaughtException(ex);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Displays properties of a clicked object. Depending on which item
 /// was clicked, the automatic link resolution may take place.
 /// </summary>
 private void ShowPropertiesClick(object sender, RoutedEventArgs e)
 {
     try
     {
         var info = new API.ShellExecuteInfo
         {
             fMask = //need all them for Properties verb
                 API.SEIFlags.SEE_MASK_INVOKEIDLIST | API.SEIFlags.SEE_MASK_NOCLOSEPROCESS |
                 API.SEIFlags.SEE_MASK_FLAG_NO_UI | API.SEIFlags.SEE_MASK_NOASYNC,
             hwnd = BtnStck.Instance.GetHandle(), //otherwise will be in background
             nShow = API.SWCommands.HIDE, //hides some other window, kind of worker one
             lpVerb = API.SEVerbs.Properties, 
             lpFile = Args4PropsAndCont(Util.ExtractRelatedPowerItem(e), ((MenuItem)sender).Name)
         };
         var executer = new Util.ShellExecuteHelper(info); //Needed to be executed on STA htread
         if (!executer.ShellExecuteOnSTAThread())
             throw new ExternalException(string.Format(
                 Power8.Properties.Resources.Err_ShellExecExErrorFormatString, executer.ErrorCode, executer.ErrorText));
     }
     catch (Exception ex)
     {
         Util.DispatchCaughtException(ex);
     }
 }