aplicación de VFP en el Registro de recordar la frecuencia de uso


Registro del sistema operativo Windows se almacena en la información del hardware del sistema, las aplicaciones, la información y la información del usuario en una base de datos, que prevé la aplicación en el mejor sitio para guardar la configuración de parámetros.En el sistema operativo Windows, cuando corremos "regedit.exe" archivos de la ventana se abre el Editor del Registro puede ver, el registro de las partes izquierda y derecha: la primera capa se llama el lado izquierdo del objetivo del Registroclave principal, haga doble clic en la clave principal de cada tecla se llama una extensión de la sub-clave; ventana de la derecha es la clave de la sub-llaves, cada tecla tiene sus valores correspondientes sub-por defecto y usar el nombre clave diferente que la clavevalor (el valor predeterminado de los cuales es nombrado claves de cadena vacía).

Leer y escribir en los datos de VFP Registro aplicación requiere el uso de WIN32API (es decir, Windows de 32 aplicaciones poco interfaz del programa) funciones, a fin de funcionar lo mismo que con la otra llamada función de VFP WIN32API, primero debe utilizar el comando DECLARE para cada función que se llamó (en), el formato DECLARE [cFunctionType] FunctionName EN LibraryName [AS aliasName];

[CParamType1 [@] ParamName1, cParamType2 [@] ParamName2, ...]

En la que el significado de los parámetros es: cFunctionType ① como el tipo de valor devuelto, pero Short, Integer y largo plazo, individuales, dobles, CUERDAS uno, si la función no devuelve ningún valor, omita cFunctionType; FunctionName ② que llamó a nombre WIN32API función, por favor tenga en cuentacaso, o en VFP DLL de la biblioteca (LibraryName) menos que la función de búsqueda y de error, si el nombre de la función con el mismo nombre que una función de VFP, la cláusula AS también puede tomar un nombre legal VFP función;. LibraryName ③ especificar una externa de Windows.nombre de la DLL, como la toma de WIN32API, VFP en el KERNEL32.DLL, GDI32.dll, USER32.DLL, MPR.DLL y FunctionName ADVAPI32.DLL búsqueda; cParamType ④ especificar el tipo de cada parámetro, puede ser INTEGER o largas de un solo,DOBLE CADENA, uno de los VFP para pasar parámetros a la función de dos maneras: por su valor y por su nombre (de referencia) se pasa, la primera sólo la variable (también constante) el valor de la función, por lo que dentro de la funciónno puede modificar el valor de la variable, esta última es la variable (no constante) la dirección a la función, que puede ser modificado dentro de la función el valor de la variable para la función de las necesidades de modificar el valor de la variable en el interior o colocados en una variablevalor de retorno de la situación.VFP delante del nombre de la variable como "@" que pasan parámetros por referencia, sin "@" que pasar parámetros por valor.Para este ejemplo, los parámetros del programa se pasa por referencia o por valor, los comandos y llamadas a funciones de la instrucción DECLARE, ver de un vistazo.

El programa de ejemplo siguiente para ejecutarse cada vez, será en la siguiente subclave del valor de registro TimesForUse nombre HKEY_CURRENT_USERSOFTWARELYTAPP más 1, hasta la carrera 12 veces hasta ahora:

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura de la clave principal y un número entero (INTEGER) valor se ajusta a saber:

# DEFINE HKEY_CLASSES_ROOT bitset (0,31) & & -2147483648
# DEFINE HKEY_CURRENT_USER bitset (0,31) 1 & & -2147483647
# DEFINE HKEY_LOCAL_MACHINE bitset (0,31) 2 & & -2147483646
# DEFINE HKEY_USER bitset (0,31) 3 & & -2147483645
# DEFINE HKEY_CURRENT_CONFIG bitset (0,31) 5 & & -2147483643
# DEFINE HKEY_DYN_DATA bitset (0,31) 6 & & -2147483642

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ principales tipos xml2dict-de sólo lectura de datos: 1 - cadena, 3 - binario, 4 - Entero

# DEFINE REG_SZ 1
# DEFINE REG_BINARY 3
# DEFINE REG_DWORD 4

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura cuando el siguiente devuelve la función API 0, la operación fue un éxito.

DECLARAN EN Win32API RegOpenKey entero;
nHKey Integer, String cSubKey @, Integer nResult @

DECLARAN EN Win32API RegCreateKey entero;
nHKey Integer, String cSubKey @, Integer nResult @

DECLARAN EN Win32API RegSetValueEx entero;
hKey entero, lpszValueName String, Integer dwReserved,;
fdwType Integer, String lpbData, cbData entero

DECLARAN EN Win32API RegQueryValueEx entero;
nHKey entero, lpszValueName String, Integer dwReserved,;
Entero @ lpdwType, cadena @ lpbData, Integer @ lpcbData

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura DECLARE entero RegDeleteKey EN Win32API;
bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura entero nHKey, String cSubKey @

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura DECLARE entero RegDeleteValue EN Win32API;
bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura entero nHKey, cSubKey String

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura DECLARE entero RegCloseKey EN Win32API;
bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.GZ-xml2dict de sólo lectura entero nHKey

csubkey =''''Softwarelytapp
nResult = 0
si RegOpenKey (HKEY_CURRENT_USER, @ csubkey, @ nResult) # 0
RegCreateKey (HKEY_CURRENT_USER, csubkey, @ nResult)
endif

bin copia de seguridad bin_old conf crawler.tar.gz crawler_bin.tar.gz google.html datos eshow generate.sh eshow_sitemap.html google.html.md5 noticias maint de registro: 10 noticias: 11 noticias: 12 noticias: 13 noticias: 14 noticias:15 noticias: 16 noticias: 17 noticias: 18 noticias: 2 noticias: 3 noticias: 4 de noticias: 5 noticias: 6 noticias: 7 de noticias: 8 noticias: 9 semillas outboundLinksMgr.sql svn sitemap.html xml2dict tmp tareas-2008.6-tar.tienda GZ-xml2dict de sólo lectura en nResult un punto en la sub-clave "HKEY_CURRENT_USERSoftwarelytapp" valor entero largo

lpdwtype = 0
lpbdata = espacio (256)
lpcbdata = len (lpbdata)
si RegQueryValueEx (, nResult''''TimesForUse, 0, lpdwtype @, @ lpbdata, @ lpcbdata) = 0
hacer caso
caso lpdwtype = REG_SZ
lpbdata = izquierda (lpbdata, lpcbdata-1)
si val (lpbdata) 12
lpbdata = ALLTRIM (STR (VAL (lpbdata) +1))
! De mensaje (''hasta que el programa no está registrado sólo puede usar 12 veces''+ CHR (13) +'''' Usted está en el signo +;
lpbdata +''uso de este procedimiento.'')
lpbdata = lpbdata + chr (0)
cbData = len (lpbdata)
RegSetValueEx (nResult'', TimesForUse'', 0, REG_SZ, lpbdata, cbData)
más
messagebox ("ha caducado" + CHR (13) + "por favor, en contacto con el registro.")
endif
lpdwtype caso = REG_BINARY
messagebox (''La clave para datos binarios.'')
caso lpdwtype = REG_DWORD
messagebox (''La clave para un conjunto de datos entero largo, por favor use el NN = 0''+ CHR (13) +''para i = 1 a 4''+ CHR (13) +;
''NN NN + = VAL (SUBSTR (lpbdata, i, 1) * 16 ^ (2 * i-2)''+ CHR (13) +;
''EndFor leer este valor.'')
de otro modo
messagebox (''datos desconocido!'')
ENDCASE
más
lpbdata =''1''
messagebox (''hasta que el programa no está registrado sólo puede usar 12 veces!''+ CHR (13) +''''Tú eres el primero lpbdata + +''de uso del programa.'')
lpbdata = lpbdata + chr (0)
RegSetValueEx (nResult'', TimesForUse'', 0, REG_SZ, lpbdata, 2)
endif

* Advertencia: cuando el usuario no está familiarizado con el registro es mejor no modificar el contenido, de lo contrario, puede dar lugar a fallos del sistema.Si el usuario desea modificar el Registro, se recomienda modificar la copia de seguridad del registro antes de lo mejor.