Search code examples
c++winapiwindows-7windows-server-2003findwindow

Program making use of FindWindowEx stops working on Server 2003, why?


I have a simple program that uses FindWindowEx & strncmp() inside a callback passed to EnumChildWindows, to find a dialog created by a third party application, and press a button.

This code works fine on my Windows 7 Ultimate PC, but if I run it on Windows Server 2003 it no longer works.

I have used Spy++ and the window captions and text are identical. Is there something I am missing about Server 2003 which may break this? (DEP and UAC are off, this is is a test PC; I am also running this inside an RDP session)

This is my call to FindWindowEx:

parentWindow = FindWindowEx(NULL,NULL,NULL,(LPCSTR)caption);

With caption being a (TCHAR[]) constant.


Solution

  • Solved.

    @sebf: Its 2011; support Unicode, idiot!