Exemple #1
0
 private void  制完整名称ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listUwpApps.SelectedItem != null)
     {
         UWP_PACKAGE_INFO pkg = ((UWP_PACKAGE_INFO)listUwpApps.SelectedItem.Tag);
         MCopyToClipboard2(pkg.AppPackageFullName);
     }
 }
Exemple #2
0
 private void 打开安装位置ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listUwpApps.SelectedItem != null)
     {
         UWP_PACKAGE_INFO pkg = ((UWP_PACKAGE_INFO)listUwpApps.SelectedItem.Tag);
         MFM_OpenFile(pkg.InstallPath, Handle);
     }
 }
Exemple #3
0
        public void UWPListRefesh()
        {
            if (Inited)
            {
                listUwpApps.Show();
                pl_UWPEnumFailTip.Hide();
                listUwpApps.Items.Clear();

                if (!M_UWP_EnumUWPApplications())
                {
                    listUwpApps.Hide();
                    pl_UWPEnumFailTip.Show();
                    lbUWPEnumFailText.Text = LanuageMgr.GetStr("UWPEnumFail", false);
                    return;
                }


                int count = M_UWP_GetUWPApplicationsCount();
                for (int i = 0; i < count; i++)
                {
                    UWP_PACKAGE_INFO info = M_UWP_GetUWPApplicationAt((uint)i);

                    TaskMgrListItem li = new TaskMgrListItem(info.DisplayName);
                    li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
                    li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
                    li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
                    li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
                    li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
                    li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
                    li.SubItems[0].Font = listUwpApps.Font;
                    li.SubItems[1].Font = listUwpApps.Font;
                    li.SubItems[2].Font = listUwpApps.Font;
                    li.SubItems[0].Text = info.DisplayName;
                    li.SubItems[1].Text = info.AppPackageFullName;
                    li.SubItems[2].Text = info.InstallPath;
                    li.SubItems[3].Text = info.AppUserModelId;
                    li.Tag      = info;
                    li.IsUWPICO = true;
                    if (info.IconBackgroundColor != 0 && info.IconBackgroundColor != 65535 && info.IconBackgroundColor != 30720)
                    {
                        li.UWPIcoColor = Uint32StrToColor((uint)info.IconBackgroundColor);
                    }

                    string iconpath = UWPSearchIcon(info.InstallPath, info.IconPath);
                    if (iconpath != "" && MFM_FileExist(iconpath))
                    {
                        using (Image img = Image.FromFile(iconpath))
                            li.Icon = IconUtils.ConvertToIcon(img);
                        // li.Image = IconUtils.GetThumbnail(new Bitmap(iconpath), 16, 16);
                    }
                    listUwpApps.Items.Add(li);
                }
            }
        }
Exemple #4
0
 private void 打开应用ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listUwpApps.SelectedItem != null)
     {
         UWP_PACKAGE_INFO pkg = ((UWP_PACKAGE_INFO)listUwpApps.SelectedItem.Tag);
         if (pkg.AppUserModelId != "")
         {
             uint processid = 0;
             M_UWP_RunUWPApp(pkg.AppUserModelId, ref processid);
         }
     }
 }
Exemple #5
0
        private TaskMgrListItem UWPForceReadAddItem(string fullName, string appfimalyid, string installDir, string dsbName, string logoPath, string bgColor)
        {
            UWP_PACKAGE_INFO info = new UWP_PACKAGE_INFO();

            info.AppPackageFullName   = fullName;
            info.AppPackageFamilyName = appfimalyid;
            info.DisplayName          = dsbName;
            info.IconPath             = logoPath;
            info.InstallPath          = installDir;

            TaskMgrListItem li = new TaskMgrListItem(info.DisplayName);

            li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
            li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
            li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
            li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
            li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
            li.SubItems.Add(new TaskMgrListItem.TaskMgrListViewSubItem());
            li.SubItems[0].Font = listUwpApps.Font;
            li.SubItems[1].Font = listUwpApps.Font;
            li.SubItems[2].Font = listUwpApps.Font;
            li.SubItems[0].Text = info.DisplayName;
            li.SubItems[1].Text = info.AppPackageFullName;
            li.SubItems[2].Text = info.InstallPath;
            li.SubItems[3].Text = info.AppUserModelId;
            li.Tag = info;
            if (bgColor != "" && bgColor != "transparent")
            {
                li.UWPIcoColor = MainUtils.HexStrToColor(bgColor);
            }
            li.IsUWPICO = true;

            string iconpath = UWPSearchIcon(info.InstallPath, info.IconPath);

            if (iconpath != "" && MFM_FileExist(iconpath))
            {
                using (Image img = Image.FromFile(iconpath))
                    li.Icon = IconUtils.ConvertToIcon(img);
            }
            listUwpApps.Items.Add(li);
            return(li);
        }