No. Clicking on a button of another application (un-related to your VB project) has no effect on your VB6 program. If, however, you have control of that other window (i.e. the source code) then you can get the button's handle by having that app send your VB program the button's handle. If you do not have any control then to get the handle of that button you will need to first get the handle of the other window by calling FindWindow API with the title bar name. Once you have the window handle you will need to set up a enumeration function in your program that loops through all the sub windows until it finds the button you need and then get the handle from there. This is complex code and I am not going to write the code to do that now as I don't have the time but I suggest you check into this by searching for how to get the handle of another window on the net (Google will have hits).




Reply With Quote