Click here to Skip to main content
15,886,137 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threadiing Pin
Tristan Rhodes7-Aug-07 4:46
Tristan Rhodes7-Aug-07 4:46 
QuestionDefault program of file. Pin
Rahul.RK7-Aug-07 0:26
Rahul.RK7-Aug-07 0:26 
AnswerRe: Default program of file. Pin
Christian Graus7-Aug-07 0:44
protectorChristian Graus7-Aug-07 0:44 
GeneralRe: Default program of file. Pin
Tormod Fjeldskaar7-Aug-07 0:49
Tormod Fjeldskaar7-Aug-07 0:49 
GeneralRe: Default program of file. Pin
Vasudevan Deepak Kumar7-Aug-07 0:49
Vasudevan Deepak Kumar7-Aug-07 0:49 
GeneralRe: Default program of file. Pin
Tormod Fjeldskaar7-Aug-07 1:16
Tormod Fjeldskaar7-Aug-07 1:16 
AnswerRe: Default program of file. Pin
Kumar Arun7-Aug-07 1:36
Kumar Arun7-Aug-07 1:36 
AnswerRe: Default program of file. Pin
Hessam Jalali7-Aug-07 1:47
Hessam Jalali7-Aug-07 1:47 
as I know it can be retrieved with shell32 FindExecutable API
but sometimes the results is not like what is Expected

Maybe this going to help

<code>

    class Shell32Utils
    {
        const int FILENOASSOCIATED = 31;
        const int FILENOTFOUND = 2;
        const int PATHNOTFOUND = 3;
        const int SUCCESS = 32; //and longer
        const int BADFORMAT = 11;

        

        [DllImport("shell32", EntryPoint = "FindExecutable")]
        static extern int FindExecutable(string file, string directory, [MarshalAs(UnmanagedType.LPStr)] StringBuilder result);


        public static string Find(string file)
        {
            string fileName=System.IO.Path.GetFileName(file);
            string filePath = System.IO.Path.GetDirectoryName(file)+"\\";

            System.Text.StringBuilder res = new StringBuilder(1024);

            int stat = FindExecutable(fileName, filePath,  res);

            switch (stat)
            {
                case FILENOASSOCIATED: throw new Exception("File Not Associated");
                case FILENOTFOUND: throw new Exception("FileNot Found");

                case PATHNOTFOUND: throw new Exception("Path not Found");

                case BADFORMAT: throw new Exception("Bad Format");

                default: if (stat >= SUCCESS) return res.ToString();
                    else throw new Exception("Unknown Error");
            }
        }       
    }

</code>


good luck
GeneralRe: Default program of file. Pin
Rahul.RK7-Aug-07 18:31
Rahul.RK7-Aug-07 18:31 
QuestionError while assigning value to a cell in a DataTable Pin
Vishnu Govind7-Aug-07 0:00
Vishnu Govind7-Aug-07 0:00 
AnswerRe: Error while assigning value to a cell in a DataTable Pin
Elayaraja Sambasivam7-Aug-07 0:11
Elayaraja Sambasivam7-Aug-07 0:11 
GeneralRe: Error while assigning value to a cell in a DataTable Pin
Vishnu Govind7-Aug-07 1:38
Vishnu Govind7-Aug-07 1:38 
GeneralRe: Error while assigning value to a cell in a DataTable Pin
Vishnu Govind7-Aug-07 2:04
Vishnu Govind7-Aug-07 2:04 
Questiondetail section of crystal report. Pin
monuSaini6-Aug-07 23:28
monuSaini6-Aug-07 23:28 
AnswerRe: detail section of crystal report. Pin
Elayaraja Sambasivam7-Aug-07 0:16
Elayaraja Sambasivam7-Aug-07 0:16 
QuestionCRL Checking Pin
Nitin Khubani6-Aug-07 23:17
Nitin Khubani6-Aug-07 23:17 
AnswerRe: CRL Checking Pin
Pete O'Hanlon6-Aug-07 23:40
mvePete O'Hanlon6-Aug-07 23:40 
QuestionTransparencyKey in MDI child form Pin
mcaos6-Aug-07 23:05
professionalmcaos6-Aug-07 23:05 
AnswerRe: TransparencyKey in MDI child form Pin
Martin#6-Aug-07 23:32
Martin#6-Aug-07 23:32 
GeneralRe: TransparencyKey in MDI child form Pin
mcaos6-Aug-07 23:39
professionalmcaos6-Aug-07 23:39 
QuestionDropDownLIst(c# window forms)-control the The Repetetions Pin
Vik Kommineni6-Aug-07 22:50
Vik Kommineni6-Aug-07 22:50 
QuestionHow to change the keyboard layout? Pin
Mic Mathi6-Aug-07 22:47
Mic Mathi6-Aug-07 22:47 
AnswerRe: How to change the keyboard layout? Pin
Hessam Jalali6-Aug-07 23:04
Hessam Jalali6-Aug-07 23:04 
GeneralRe: How to change the keyboard layout? Pin
Mic Mathi6-Aug-07 23:48
Mic Mathi6-Aug-07 23:48 
GeneralRe: How to change the keyboard layout? Pin
Hessam Jalali7-Aug-07 0:32
Hessam Jalali7-Aug-07 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.