HI Subrat;
FYI: These are the External Declarations that I use in my STD Framework for a FindWindow call ...
- FUNCTION uLong FindWindow ( ref String classname, ref string windowname ) Library "USER32.DLL" ALIAS FOR "FindWindowW"
- FUNCTION uLong FindWindowEx ( uLong hwnd, uLong childAfter, ref string classname, ref string windowname ) LIBRARY "USER32.dll" ALIAS FOR "FindWindowExW"
- FUNCTION uLong FindWindowEx ( uLong hwnd, uLong childAfter, long classname, ref string windowname ) LIBRARY "USER32.dll" ALIAS FOR "FindWindowExW"
- FUNCTION uLong FindWindowEx ( uLong hwnd, uLong childAfter, ref string classname, long windowname ) LIBRARY "USER32.dll" ALIAS FOR "FindWindowExW"
FWIW: The above SDK calls are all working perfectly in both 32 bit and 64 bit Apps built from the framework.
Note: When you call the FindWindow SDK though, you need to nullify the ClassName. For example:
String ls_class // Windows Class Name
LongPtr lp_handle // Window's "handle"
SetNull (ls_class) // Set Class 2 NULL (all)
lp_handle = THIS.FindWindow ( ls_class, as_title ) // Try to locate it!
If lp_handle = 0 THEN // Found?
lp_handle = THIS.FindWindowEx (0, 0, ls_class, as_title ) // NO=>Try Extended search!
END IF
The above example is actual code from the STD framework. HTH
Regards ... Chris