TSNStd/Src/WinAPIExt/Run.mqh
60 linhas
2,2 KiB
MQL5
Nique_372
2026-10-31 13:16:39 -05:00
//+------------------------------------------------------------------+
//| Run.mqh |
//| Copyright 2026, Niquel Mendoza. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Niquel Mendoza."
#property link "https://www.mql5.com"
#property strict
#ifndef TSNSTD_SRC_WINAPIEXT_RUN_MQH
#define TSNSTD_SRC_WINAPIEXT_RUN_MQH
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include <WinAPI\windef.mqh>
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#import "user32.dll"
PVOID SendMessageW(HANDLE, uint, PVOID, int &[]);
PVOID SendMessageW(HANDLE, uint, PVOID, short &[]);
#import
struct pack(8) SECURITY_ATTRIBUTES
{
uint nLength;
PVOID lpSecurityDescriptor;
int bInheritHandle;
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//---
#import "kernel32.dll"
uint WaitForSingleObject(HANDLE hHandle, uint dwMilliseconds);
int CreatePipe(HANDLE &hReadPipe, HANDLE &hWritePipe, SECURITY_ATTRIBUTES &lpPipeAttributes, uint nSize);
int CreateFileW(const string file_name, uint desired_access, uint share_mode, SECURITY_ATTRIBUTES &security_attributes, uint creation_disposition, uint flags_and_attributes, HANDLE template_file);
#import
#define INFINITE 0xFFFFFFFF
#define WAIT_TIMEOUT_VAL 0x102
#define STARTF_USESHOWWINDOW 0x00000001
#define STARTF_USESTDHANDLES 0x00000100
//---
#import "shell32.dll"
int ShellExecuteW(int hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, int nShowCmd);
#import
//---
#define SW_SHOW 5
#define SW_HIDE 0
//---
#endif // TSNSTD_SRC_WINAPIEXT_RUN_MQH