| / | Forum |
|
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 |