Ver Mensaje Individual
  #3  
Antiguo 23-02-2025
navbuoy navbuoy is offline
Miembro
 
Registrado: mar 2024
Posts: 360
Reputación: 3
navbuoy Va por buen camino
Debes incluir ShellAPI.hpp en tu unidad.

Código:
#include <Vcl.ShellAPI.hpp>
La función tiene la siguiente forma:

Código:
ShellExecute(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
Parámetros Importantes
hwnd → Ventana padre (Handle del formulario o nullptr).
lpOperation → Acción a realizar (L"open", L"edit", L"print").
lpFile → Archivo, programa o URL a abrir.
lpParameters → Parámetros del programa (opcional, nullptr si no se usa).
lpDirectory → Carpeta de trabajo (opcional, nullptr si no se usa).
nShowCmd → Modo de visualización (SW_SHOWNORMAL, SW_HIDE, etc.).


Ejemplo 1: Abrir una Página Web en el Navegador Predeterminado

Código:
#include <Vcl.ShellAPI.hpp>

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    ShellExecute(Handle, L"open", L"https://www.embarcadero.com", nullptr, nullptr, SW_SHOWNORMAL);
}
probablemente te falla porque tienes que poner esa "L" delante de "open" y de la URL
Responder Con Cita