none
VB6 RRS feed

  • Pregunta

  • Hola a todos, se que esta pregunta no debe de estar en este foro, pero tal vez alguien sabe que sucede, tengo un aplicacion en vb6 y resulta que utilizo la funcion SendKeys y funciona bien, excepto en windows vista, al momento de pasar por esa instruccion me dice que no tiene acceso, alguien sabe como solucionar esto. de ante mano muchas gracias.

    • Cambiado Enrique M. Montejo lunes, 2 de mayo de 2011 9:17 Pregunta relacionada con el lenguaje VB 5/6 (De:Lenguaje VB.NET)
    sábado, 3 de noviembre de 2007 15:48

Respuestas

  • Que tal

     

    SendKeys no funciona en Vista, debes reescribir esas funciones por llamadas al API.

     

    Estos son algunos de los cambios que hay que realizar en aplicaciones VB6 para que funcionen en Vista (está en inglés, espero le entiendan):

     

    Application Changes

    Remove SendKeys calls and replace them with API code.
    Use the HKEY_CURRENT_USER in the registry for the settings of your application. Do not write to HKEY_LOCAL_MACHINE.
    If you are using ADO use 2.8 and above in your application.
    If you are using XML use XML version 3.0 and above in your application
    If you are using the PlaySound API, if your wave files are not PCM but mpeg layer-3 make sure your mpeg wave files are Stereo and not Mono.
    If you need the Printer Setup dialog either using the Common Dialog Control, or by using the API functions, the dialog will not return the correct number of copies. The dialog will always return 1 on Vista. The way around this bug is to create your own Printer Setup dialog box and when you get the correct number of copies you will have to send to the printer multiple times to print out multiple copies. Here is a link that discusses this issue in details.
    Relocate settings files, data files etc into "Common Files" (C:\Users\Public) instead of "Program Files". You should use the API calls to locate these folders because the folders are in different paths for different machines and OSs. Here is a link that discusses this issue in details.
    Per-user settings should be in a separate file located under "Application Data" and this should also be requested of the OS in the same manner.
    For "Common Files" ask for ssfCOMMONDATA (or CSIDL_COMMON_APPDATA).
    For "Application Data" ask for ssfAPPDATA (or CSIDL_APPDATA). To properly use these filesystem locations you are supposed to create a subdirectory for your "company name" and under that another for your "application name." Then put your settings or data under that.
    Any working "document" files that are meant to be found and manipulated by the user (i.e. via Explorer) should be placed into CSIDL_PERSONAL ("My Documents") or CSIDL_COMMON_DOCUMENTS ("All Users\Documents").

    Setup Package Changes

    Administrator Account running your Setup Package

    Require users to "Run as Administrator" directly in your setup package.
    Inform users to right-click the setup package and click "Run As Administrator".

    Non-Administrator Account running your Setup Package

    Remove the VB6 Runtime files, MDAC and any of these files from your setup package.

    Visual Basic IDE Changes

    If you are using Visual Basic 6.0 on Vista, you will notice a latency in speed. This can be solved by using "Windows Classic Theme" or "Windows Vista Basic theme" instead of the new Vista Theme with the Aero effect.

    Useful Links

    Teach Your Apps To Play Nicely With Windows Vista User Account Control
    Understanding and Configuring User Account Control in Windows Vista

     

    Saludos
    lunes, 5 de noviembre de 2007 1:01