MQL4 - automated forex trading   /  

Forum

Call to GetActiveWindow() doesn't work

Back to topics list To post a new topic, please log in or register

avatar
17
bwilhiteforex 2007.01.26 13:37 
I am trying to pass messages between various windows. At first I was trying to use FindWindow() to obtain the handles of various windows, but my results always came up as 0. So I decided to try just getting the handle of the calling window through GetActiveWindow(). Again, the result is 0. Why is this not working? Script code posted below:

//+------------------------------------------------------------------+
//| SendWinMessage. mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#include <WinUser32.mqh>
#import "WinUser32"
int GetActiveWindow();
#import


int errorcatch = 0;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int result;
result = GetActiveWindow();
errorcatch = MessageBox("The result is: " + result);
//----
return(0);
}
//+------------------------------------------------------------------+

BW

Back to topics list  

To add comments, please log in or register