WinApi get Get Program Files directory

In this category you can exchange your programming questions and solutions.
Post Reply
cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

WinApi get Get Program Files directory

Post: # 970Post cvirus
Wed Sep 19, 2012 11:12 am

Hello admn, i want to get the program files folder but i do not know how, i could use the fullpath in a string but i`m coding in a seven machine and when i trie in a xp machine the path isn?t the same and doesn?t work.

So i search from api stuff for a solution but i do not know if it works.

The function that i found was ->SHGetSpecialFolderLocation with a const CSIDL_PROGRAM_FILES.

Does this work? :o

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

WinApi get Get Program Files directory

Post: # 971Post Marco
Wed Sep 19, 2012 8:53 pm

You can get the path from the registry:

dim reg as registry
dim key as string
key="HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionProgramFilesDir"
showmessage reg.readkey(key)

best regards

cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

WinApi get Get Program Files directory

Post: # 972Post cvirus
Wed Sep 19, 2012 9:16 pm

And can i pass that key to the comand run so that my app could invoque other program?

And can you give an font example so that i can change the font type and color?

Thanks

cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

WinApi get Get Program Files directory

Post: # 973Post cvirus
Thu Sep 20, 2012 10:19 am

Thanks for the reg example i got it working now.

Only need a Font example :D

cvirus
Posts: 88
Joined: Tue Jan 12, 2010 8:33 pm

WinApi get Get Program Files directory

Post: # 974Post cvirus
Thu Sep 20, 2012 3:39 pm

Got it, thanks for The FNXBASIC. ::)

Post Reply