How to get window handle from .exe name on WinCE ? lazarus / 35-Windows CE ---------------------------------------------------------------------- BlueWings · 2010-07-09 13:22 Hello Anybody, I wonder the smartest way to get the window handle number for another app created in MS Visual Studio 2008. I know the .exe name, the window title that has nonstandard ASC characters ('Kártyaolvasó'), but not sure about the classname. FindWindow(nil,'Form1'); returns a number a bit below 2^31, assumably for my own app, but FindWindow(nil,'OtherAppTitle'); gives zero. Surprisingly, FindWindow(nil,'Power'); also gives a handle, when Control Panel -> Power is open, and this window looks exactly the same as MyOtherApp's window. I'm afraid the Power window which is a builtin Windows component was created neither in Lazarus nor using FreePascal. Any ideas why I don't get the handle for MSVS2008 App ? Cheers, Peter ---------------------------------------------------------------------- theo · 2010-07-09 13:47 I don't know much about it, I'm on Linux. But since it's a Windows API call, it won't accept UTF-8. so try either Findwindow(nil, UTF8Decode(WindowName)) or Findwindow(nil, UTF8ToSys(WindowName)). Maybe there are also FindWindowW (Unicode) and FindWindowA (ANSI) versions ---------------------------------------------------------------------- mas steindorff · 2010-07-09 18:22 I do not know the answar to your question by I can recomend process explorer from Sysinternals as a tool for this kind of stuff