コード例 #1
0
        private void CmdBrowse_Click(object sender, System.EventArgs e)
        {
            uint TheIndex = 0;             // For The Icon

            OpenFileDialog MyDia = new OpenFileDialog();

            MyDia.Title  = "Choose File To Execute";
            MyDia.Filter =
                "All Supported Files|*.exe;*.com;*.bat;*.vbs;*.js;*.wsf|Executable Files(*.exe)|*.exe|Batch & Com Files(*.bat)(*.com)|*.bat;*.com|Scribt Files (*.vbs)(*.js)(*.wsf)|*.vbs;*.js;*.wsf|All Files (*.*)|*.*";

            if (MyDia.ShowDialog(this) == DialogResult.OK)
            {
                FileInfo MyFile = new FileInfo(MyDia.FileName);

                TxtCommandAddEdit.Text = MyDia.FileName;

                pictureBox1.Image = null;                 //Empty It First
                pictureBox1.Image = Bitmap.FromHicon      //Get It From handle
                                    (
                    ClsAPICalls.GetExtensionIcon(this.Handle, TxtCommandAddEdit.Text, ref TheIndex)
                                    );

                if (TxtNameAddEdit.Text == "")                   //Try To Insert name if the user didn't yet
                {
                    // PUT THE FILE NAME IN TXTNAME
                    TxtNameAddEdit.Text = MyFile.Name.Remove(MyFile.Name.Length - 4, 4);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// This Method takes the path to the file and then returns its icon handle HICON
        /// </summary>
        /// <param name="TheIconPath">Path To File</param>
        /// <returns>The Icon Handle</returns>

        internal IntPtr AHandle(string TheIconPath)
        {
            IntPtr GlobalIntPtr     = IntPtr.Zero;
            uint   GlobalImageIndex = 0;

            return
                (ClsAPICalls.GetExtensionIcon(GlobalIntPtr, AnalyzeIt(TheIconPath), ref GlobalImageIndex));
        }
コード例 #3
0
ファイル: FrmMainM.cs プロジェクト: candseeme/Startup-Edit
 private void IsdalMainProp_Click(object sender, System.EventArgs e)
 {
     if (CheckForEntryPoint())
     {
         ClsAPICalls.CallPropDialog(this.Handle, ClsAPICalls.GetProperties.SHOP_FILEPATH,
                                    MyAction.AnalyzeIt(ViewMain.FocusedItem.SubItems[1].Text), null);
         return;
     }
     MessageBox.Show
         ("Hi Man \n Your Shell32.dll Is Out Of Date Version 5 or Higher Is Required");
 }
コード例 #4
0
        /// <summary>
        /// To Read The File Icon
        /// </summary>
        void ReadImage()
        {
            try
            {
                uint TheIndex = 0;

                IconBox.Image = null;
                IconBox.Image = Bitmap.FromHicon
                                (
                    ClsAPICalls.GetExtensionIcon(this.Handle, TxtTaskManager.Text, ref TheIndex)
                                );
            }
            catch
            {
                TxtTaskManager.Text = "Unable To Read The File Icon";
            }
        }