Here is the code: ctrlWindow is a Mex file. Window Name 1 is the result of program1.exe. Window Name 2 is the result of MATLAB GUI. When I click F9 after selecting the entire code, works great. Screens get switched. But when I do F5, there is window identification issue. MATLAB returns, unable to identify the window. Any thoughts?
% code begins
!program1.exe
ctrlWindow('Window Name 1',3);
pause(1)
ctrlWindow('Window Name 1',0)
pause(1)
ctrlWindow('Window Name 2',3);
pause(1)
ctrlWindow('Window Name 2',0)
pause(1)