Página 1 de 1

Executar um aplicativo com data mais recente

Enviado: 24 Fev 2017 14:08
por porter
olá pessoal, com a rotina abaixo, executo um aplicativo, qual comando alem do RUN eu poderia usar, tentei com
WAPI_ShellExecute, mas não está dando certo, da erro de compilação, estou tentando executar entre vários exe, o executavel mais recente,
gostaria de saber se existem outras opções, que seja usando alguma lib ou alguma outra forma, apenas para conhecer
novas possibilidades para implementar no meu sistema.
estou compilando com o xHarbour

Código: Selecionar todos

oExeList := Directory( cPath + "EST*.EXE" )
ASort( oExeList, , , { | a, b | Dtos( a[ F_DATE ] ) + a[ F_TIME ] > Dtos( b[ F_DATE ] ) + b[ F_TIME ] } )
qual = "ESTOQUE.EXE"
run &qual
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6633)


Error: Unresolved external '_HB_FUN_WAPI_SHELLEXECUTE' referenced from C:\SYS212\PRINCIPAL.OBJ
Error: Unresolved external '_HB_FUN_HB_CWD' referenced from C:\LOJA\ESTOQUE.OBJ

Executar um aplicativo com data mais recente

Enviado: 24 Fev 2017 15:58
por Kapiaba

Código: Selecionar todos

#include "hbdll.ch"

// Native style
IMPORT HWND GetActiveWindow(VOID) FROM User32.dll
IMPORT int MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType ) FROM User32.dll //EXPORTED AS MessageBoxA

// FoxPro style Decleration
DECLARE Integer GetVolumeInformation IN Kernel32.dll ;
        String lpRootPathName, String @ lpVolumeNameBuffer, ;
        Integer nVolumeNameSize, Integer @ lpVolumeSerialNumber, ;
        Integer @ lpMaximumComponentLength, Integer @ lpFileSystemFlags, ;
        String @ lpFileSystemNameBuffer , Integer nFileSystemNameSize

// FWH style decleration
DLL FUNCTION ShellExecute( hWnd AS LONG, cOperation AS LPSTR,;
                             cFile AS LPSTR, cParams AS LPSTR,;
                             cDir AS LPSTR, nShow AS LONG ) AS LONG PASCAL ;
                             FROM "ShellExecuteA" LIB "shell32.dll"

#define VOLUME_BUFFER_SIZE 256

PROCEDURE Main()

  LOCAL cVolumeName := Space(VOLUME_BUFFER_SIZE)
  LOCAL nSerial     := 0
  LOCAL hParent := GetActiveWindow()

  //? hParent

  MessageBox( hParent, "Welcome to the fun world of xHarbour", "xHarbour Dll access to WinAPI", 0 )

  GetVolumeInformation( "C:\", @cVolumeName, VOLUME_BUFFER_SIZE, @nSerial, 0, 0, 0, 0 )
  ? "Volume:", Trim( cVolumeName ), "Serial:", NumToHex( nSerial, 8 )

  ShellExecute( 0, "Open", "http://www.xharbour.org/", 0 )


  // ShellExecute(,"Open","Outlook",,,3)

  // ShellExecute( 0, "open", "kill.bat",,, )

RETURN

Executar um aplicativo com data mais recente

Enviado: 24 Fev 2017 16:12
por Claudio Soto
Ver por ej
http://www.creasolgroup.com/xOraclipLan ... _f.en.html

Executar um aplicativo com data mais recente

Enviado: 24 Fev 2017 18:52
por porter
olá Kapiaba,
Compila normalmente e executa, mas não acontece nada, gostaria de ver o que faz essa rotina que você passou para
ver se posso adequar ao meu sistema.

Obrigado.

Executar um aplicativo com data mais recente

Enviado: 25 Fev 2017 09:35
por porter
Agora deu certo, estou conseguindo executar a rotina, vou estuda-la e adaptar ao meu sistema.

Obrigado.