GETPROGDIR()

GETPROGDIR()

Postby Romeo » Mon Sep 17, 2007 3:42 pm

Hi,
is it possible to kwnow where VISTA puts (the folder) the program menu installed ?

Undex XP i used the function GETPROGDIR() the retrieve it, but undex VISTA it does not work.

Undex XP i usually got the folder:

C:\Documents and Settings\All Users\Starts Menu\Programs\MY-FODER

where MY-FOLDER is my searched folder.

Any help ?
tks
Romeo/Zingoni



--------------------------------------------------------------------------------

Salve,
sapete dove mette VISTA i programmi che si installano con la procedura di FWIN/HARBOUR ?
Per intenderci quelli che usano:
*************
DEFINE DDE oDDE ;
SERVICE "Progman" ;
TOPIC "Progman"
ACTIVAT DDE oDDe

oDDE:Execute(....)
.
.
RELEASE DDE oDDE
***************
Con XP va tutto bene, mantre con VISTA creo correttamente il gruppo ma non so (in che cartella) lo va a scrivere.

Usavo la funzione recuperata sul forum GESTPROGDIR() per saperlo e con XP funziona ma VISTA la va a mettere in una stranissima cartella.

C'e' in giro qualche funzione per recuperarla !

Grazie

Romeo/Zingoni
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Postby Antonio Linares » Mon Sep 24, 2007 8:52 am

Romeo,

> Undex XP i used the function GETPROGDIR() the retrieve it

What function is that one ? It does not seems to be a FW/FWH one
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41323
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Mon Sep 24, 2007 10:40 am

I think it's mine:

Code: Select all  Expand view
#define HKEY_CURRENT_USER  2147483649
#define HKEY_LOCAL_MACHINE 2147483650

#define KEY_ALL_ACCESS 983103


FUNCTION GETPROGDIR()

    LOCAL hKey := 0

    LOCAL nType := 0

    LOCAL cData := SPACE( 256 )

    LOCAL nSize := LEN( cData )

    IF !ISWINNT()
        REGOPENKEY( HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", 0, KEY_ALL_ACCESS, @hKey )
        REGQUERYVALUE( hKey, "Programs", 0, @nType, @cData, @nSize )
    ELSE
        REGOPENKEY( HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", 0, KEY_ALL_ACCESS, @hKey )
        REGQUERYVALUE( hKey, "Common Programs", 0, @nType, @cData, @nSize )
    ENDIF

    REGCLOSEKEY( hKey )

    RETURN LEFT( cData, AT( CHR( 0 ), cData ) - 1 )


DLL32 FUNCTION REGOPENKEY( hKey AS LONG, cSubKey AS LPSTR, nOptions AS DWORD, nSamDesired AS DWORD, @nHandle AS PTR ) AS LONG;
      PASCAL FROM "RegOpenKeyExA" LIB "advapi32.dll"

DLL32 FUNCTION REGQUERYVALUE( hKey AS LONG, cValueName AS LPSTR, nReserved AS LONG, @nType AS PTR, @cData AS LPSTR, @nSize AS PTR ) AS LONG;
      PASCAL FROM "RegQueryValueExA" LIB "advapi32.dll"

DLL32 FUNCTION REGCLOSEKEY( hKey AS LONG ) AS LONG;
      PASCAL FROM "RegCloseKey" LIB "advapi32.dll"


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8331
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Mon Sep 24, 2007 10:50 am

Enrico,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41323
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby nageswaragunupudi » Mon Sep 24, 2007 12:42 pm

Mr. Enrico

Excellant.

I am now using the following for the above purpose.
Code: Select all  Expand view
GetObject('WScript.Shell'):SpecialFolders:Item('AllUsersPrograms')


(Getobject is my function which is nothing but try GetActiveObect cach createobject ... )

This is working on XP and 2000/2003. I personally dont have access to other windows versions.

Can you or anyone else please advise if this works on other versions too? In particular Vista ?

Regards

Nageswara Rao
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10254
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 10 guests