Page 1 of 1

WinApi get Get Program Files directory

Posted: Wed Sep 19, 2012 11:12 am
by cvirus
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

WinApi get Get Program Files directory

Posted: Wed Sep 19, 2012 8:53 pm
by Marco
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

WinApi get Get Program Files directory

Posted: Wed Sep 19, 2012 9:16 pm
by cvirus
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

WinApi get Get Program Files directory

Posted: Thu Sep 20, 2012 10:19 am
by cvirus
Thanks for the reg example i got it working now.

Only need a Font example :D

WinApi get Get Program Files directory

Posted: Thu Sep 20, 2012 3:39 pm
by cvirus
Got it, thanks for The FNXBASIC. ::)