Does anyone know of an FLL that is already out there that implements
the SHGetSpecialFolderLocation API function to get the user' desktop? I
don't know much about using the windows API from c++ so, if there were
one already made would be great.

I do know about using windows scripting to get the users desktop, but I
would like to use something a little more reliable. (windows scripting
may be turned off)

Any ideas, suggestions, leads to an fll..?

Thanks!

Re: User's Desktop - VFP9 by Dan

Dan
Fri Mar 31 11:47:49 CST 2006

Is your heart really set on a FLL or API call? You don't need either.

? Addbs(Getenv("HOMEDRIVE"))+Addbs(Getenv("HOMEPATH"))+Addbs("desktop")

Dan

deciacco wrote:
> Does anyone know of an FLL that is already out there that implements
> the SHGetSpecialFolderLocation API function to get the user' desktop?
> I don't know much about using the windows API from c++ so, if there
> were one already made would be great.
>
> I do know about using windows scripting to get the users desktop, but
> I would like to use something a little more reliable. (windows
> scripting may be turned off)
>
> Any ideas, suggestions, leads to an fll..?
>
> Thanks!



Re: User's Desktop - VFP9 by deciacco

deciacco
Fri Mar 31 12:30:41 CST 2006

No not at all..just didn't know I could do that from within Fox...
Thank you!! Greatly appreciated....


Re: User's Desktop - VFP9 by Paul

Paul
Fri Mar 31 13:25:20 CST 2006

But that depends on those environment variables being defined, right? Can
you always count on them?


"Dan Freeman" <spam@microsoft.com> wrote in message
news:uxfa7sOVGHA.5092@TK2MSFTNGP10.phx.gbl...
> Is your heart really set on a FLL or API call? You don't need either.
>
> ? Addbs(Getenv("HOMEDRIVE"))+Addbs(Getenv("HOMEPATH"))+Addbs("desktop")
>
> Dan
>
> deciacco wrote:
>> Does anyone know of an FLL that is already out there that implements
>> the SHGetSpecialFolderLocation API function to get the user' desktop?
>> I don't know much about using the windows API from c++ so, if there
>> were one already made would be great.
>>
>> I do know about using windows scripting to get the users desktop, but
>> I would like to use something a little more reliable. (windows
>> scripting may be turned off)
>>
>> Any ideas, suggestions, leads to an fll..?
>>
>> Thanks!
>
>



Re: User's Desktop - VFP9 by Dan

Dan
Fri Mar 31 14:10:37 CST 2006

I've never seen them missing. <shrug>

But yes, it does depend on them existing.

Dan

Paul Pedersen wrote:
> But that depends on those environment variables being defined, right?
> Can you always count on them?
>
>
> "Dan Freeman" <spam@microsoft.com> wrote in message
> news:uxfa7sOVGHA.5092@TK2MSFTNGP10.phx.gbl...
>> Is your heart really set on a FLL or API call? You don't need either.
>>
>> ?
>> Addbs(Getenv("HOMEDRIVE"))+Addbs(Getenv("HOMEPATH"))+Addbs("desktop")
>>
>> Dan
>>
>> deciacco wrote:
>>> Does anyone know of an FLL that is already out there that implements
>>> the SHGetSpecialFolderLocation API function to get the user'
>>> desktop? I don't know much about using the windows API from c++ so,
>>> if there were one already made would be great.
>>>
>>> I do know about using windows scripting to get the users desktop,
>>> but I would like to use something a little more reliable. (windows
>>> scripting may be turned off)
>>>
>>> Any ideas, suggestions, leads to an fll..?
>>>
>>> Thanks!



Re: User's Desktop - VFP9 by Rolf

Rolf
Fri Mar 31 14:21:16 CST 2006

> ? Addbs(Getenv("HOMEDRIVE"))+Addbs(Getenv("HOMEPATH"))+Addbs("desktop")

You can't trust that to be correct.
I do it like this:

m.userdesktop = get_folder(16)


get_folder.prg goes like this:

LPARAMETERS m.Foldernum
* 26 = appdata
* 16 = users desktop
Local m.mvtest,m.lcPath
Local m.nRet
Local Array aDLLsLoaded(1)
m.nRet=Adlls(aDLLsLoaded)
If m.nRet = 0 .Or. Ascan(aDLLsLoaded, 'SHGetFolderPath' , 1 ,
Alen("aDLLsLoaded",1) , 2 , 9) = 0
Declare Integer SHGetFolderPath In SHFOLDER.Dll Integer hwndOwner, Integer
nFolder, Integer hToken, Integer dwFlags, String @ pszPath
Endif
If m.nRet = 0 .Or. Ascan(aDLLsLoaded, 'GetActiveWindow' , 1 ,
Alen("aDLLsLoaded",1) , 2 , 9) = 0
Declare Integer GetActiveWindow In WIN32API
Endif
m.lcPath = Replicate(Chr(0),261)
=SHGetFolderPath(GetActiveWindow(), m.Foldernum , 0 , 0 , @m.lcPath )
return Addbs(Left(m.lcPath,At(Chr(0),m.lcPath)-1) )



Re: User's Desktop - VFP9 by Leemi

Leemi
Fri Mar 31 14:33:49 CST 2006

Hi deciacco:

This article may help. It uses the API you mention:

194702 How to locate Windows special folder locations
http://support.microsoft.com/default.aspx?scid=kb;EN-US;194702


I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003


> Does anyone know of an FLL that is already out there that implements
> the SHGetSpecialFolderLocation API function to get the user' desktop?
> I don't know much about using the windows API from c++ so, if there
> were one already made would be great.
>
> I do know about using windows scripting to get the users desktop, but
> I would like to use something a little more reliable. (windows
> scripting may be turned off)
>
> Any ideas, suggestions, leads to an fll..?
>
> Thanks!