거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
스크립트

Get message of Popup Alert MT4 using - MetaTrader 4용 스크립트

조회수:
4197
평가:
(4)
게시됨:
2022.12.31 09:08
업데이트됨:
2023.03.28 06:06
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

this is small script using external DLL "user32.dll".

1. Import Dll and its functions

#define WM_GETTEXTLENGTH 0xE
#define WM_GETTEXT 0xD


#import "user32.dll"
   int FindWindowW(string lpClassName, string lpWindowName);
   int FindWindowExW(int hWnd1, int hWnd2, string lpsz1, string lpsz2);
   int SendMessageA(int hwnd, int wMsg, int wParam, int lParam);
   int SendMessageA(int hwnd, int wMsg, int wParam, char &lParam[]); //Edit lParam to receive value return
#import
//+------

2 Get Handle of Alert Dialog (parent window)

using FindWindowW to specific parent window handle

   int Hwnd = 0; //handle of parent window
   int CHwnd = 0; //handle of textbox
   
   Hwnd = FindWindowW("#32770", "Alert");//replace FindWindowA to FindWindowW for mql4

3. Get Handle of Textbox (or label) in Dialog (child window)

using FindWindowExW to specifit child window handle

   //Get handle of textbox in Dialog
   CHwnd = FindWindowExW(Hwnd, 0, "Edit", NULL);//Find All control have class name is "Edit"

3. Get Content of message from textbox

   3.1 Need to specify the length of the string:

   //Get content of Message in textbox
   //Get length of message string
   int textLength = SendMessageA(CHwnd, WM_GETTEXTLENGTH, 0, 0);

  3.2 Get content

   string contentMsg = "";
   char ch[540];
   for(int i = 0; i < ArraySize(ch); i++) ch[i] = 0x000;
   
   ArrayInitialize(ch, 0x000);
   
   int length = SendMessageA(CHwnd, WM_GETTEXT, textLength + 1, ch);
   
   for(int i = 0; i < length; i++) contentMsg += CharToString(ch[i]);
   
   Print(__FUNCTION__, "--> Content Message = "+ contentMsg);

Get more information for tutorial video:


RSI Scanner RSI Scanner

Simple indicator that will scan thru the symbols in the MarketWatch window to alert you if price is overbought or oversold based on RSI.

TradeMo TradeMo

The trade strategy is based on 2 moving averages. To confirm the trend, it uses 2 moving averages crossing and 1 candlestick formation while the moving averages are still crossed.

Time Segmented Volume (TSV) Time Segmented Volume (TSV)

Based on the original “Time Segmented Volume (TSV)” developed by Worden Brothers, Inc.

Auto Fibonacci Indicator (Auto Fibos) Auto Fibonacci Indicator (Auto Fibos)

- indicator for MetaTrader 4