LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
Alphi
Tail-Wagger
Tail-Wagger


Joined: 05 Apr 2002
Age: 36
Posts: 2987
Location: Grand Rapids, MI USA

Post Posted: Mon Apr 21, 2008 5:57 am   Post subject: Determine file-type and application association - Windows XP Reply with quote Back to top  

Hey guys,

I need to find a way to, based on a file's extension, determine what application to open up.


I know all that data is there in Windows somewhere (probably in the Registry somewhere), since I know if I double-click on a XLS file, it magically knows to open MS Excel.


But my program needs to do that - where can I find that data, so that, for example, if I look for the file type DOC, I find: "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" or at least something similar that I can work with?

_________________
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.
- Benjamin Franklin


Prosper.com - P2P lending
View user's profile Send private message Send e-mail ICQ Number
ThunderDawg
Alpha Dog
Alpha Dog


Joined: 14 Apr 2002
Posts: 16270
Location: In a Godda da Vita, Honey

Post Posted: Mon Apr 21, 2008 6:03 am   Post subject: Reply with quote Back to top  

http://filext.com/

_________________
The ONE thing EVERYONE has in Common is that they think they are Above Average Drivers.
View user's profile Send private message
T
Curmudgeon


Joined: 17 May 2001
Posts: 15914
Location: Airstrip One

Post Posted: Mon Apr 21, 2008 6:08 am   Post subject: Reply with quote Back to top  

HKEY_CLASSES_ROOT
HKEY_LOCAL_MACHINE\SOFTWARE\Classes (HKEY_CLASSES_ROOT is a copy of this one)

_________________
Got questions? Click here.
Still got questions? Click here, too.

affabletoaster, Akely, anglachel, blahpony, CMTG, EdisonRex, Elk, Equin, evilness, Fido, fathertyme, Goddess, Jaymac, je, jodygirl, KingKobra, Lycander, mally, Max, OhioArt2, perrito_blanco, Rover, Spot, sully_51, the taz man, thriftyjack, twiztid, wrathiron, yiayia49

A journey of 3,500 miles begins with a single comic.

Would you like
good music at a price that is right? CD Baby, baby.



Elf booty got soul. Elf girls like to rock and roll.
View user's profile Send private message Visit poster's website
CMTG
Leg Humper
Leg Humper


Joined: 23 Feb 2002
Posts: 4822
Location: On average, Cheltenham.

Post Posted: Mon Apr 21, 2008 6:13 am   Post subject: Reply with quote Back to top  

MSDN is your friend:

http://support.microsoft.com/kb/170918
http://msdn2.microsoft.com/en-us/library/bb762153.aspx

Quote:
You can use the Windows API ShellExecute() function to start the application associated with a given document extension without knowing the name of the associated application.

_________________
Pie. I wish I could
constrain my hungry greed but...
Sadly, defeated.


So I'm cruising in my '91 Daihatsu blasting Vanessa Carlton's rockin' smash hit "A Thousand Miles," when it suddenly occurs to me:
"Am I
too gangsta? Am I too hardcore and menacing for this world?" I just might be.
- Tatsuya Ishida
View user's profile Send private message Send e-mail Visit poster's website
Alphi
Tail-Wagger
Tail-Wagger


Joined: 05 Apr 2002
Age: 36
Posts: 2987
Location: Grand Rapids, MI USA

Post Posted: Mon Apr 21, 2008 7:23 am   Post subject: Reply with quote Back to top  

That works... Thanks guys!

_________________
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.
- Benjamin Franklin


Prosper.com - P2P lending
View user's profile Send private message Send e-mail ICQ Number
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!