Is a7.EngFun.engine_frame() analagous to wait(1)?

I'm experimenting with window handles and the Win32 API and i'm using vars such as a7.EngVar.hWnd and a7.EngVar.hWndTarget. The manual states that these variables only become available after 1 frame, so wait(1) is needed.

I'm using the API call GetWindowText to test if I can get the text of the engine Hwnd...

Code:
[DllImport("user32.dll", EntryPoint = "GetWindowText", CharSet = CharSet.Ansi)]
        public static extern bool GetWindowText(IntPtr hWnd, [OutAttribute()] StringBuilder strNewWindowName,
            Int32 maxCharCount);

        static void Main(string[] args)
        {
            a7.EngFun.engine_open(null);
            a7.EngFun.engine_frame(); // acts as wait(1) ???

            StringBuilder sb = new StringBuilder(256);
            GetWindowText(a7.EngVar.hWnd, sb, sb.Capacity);
            MessageBox.Show(sb.ToString());

            while (a7.EngFun.engine_frame() != 0)
            {

            }
        }
    }



...But every time the string buffer is empty. I've tested this code on other applications like notepad.exe, by getting it's handle, and it returns the name in the title bar no problems.

So is there a problem with my code? Or are the engine vars not functioning properly?