Opposite of FindClass$
Blitz3D Forums/Blitz3D Programming/Opposite of FindClass$
| ||
API.lib "user32.dll" api_FindWindowB% (lpClassName, lpWindowName$) : "FindWindowA" Code Function FindClass$(t1$) b = api_FindWindowB(0, t1$) bbank = CreateBank(256) length = api_GetclassName( b, bbank, 255 ) For i = 0 To length - 1 class1$ = class1$ + Chr$(PeekByte(bbank, i)) Next FreeBank bbank ;DebugLog("Class = " + class1$) Return class1$ End Function Any ideas on how to do the opposite? ('FindTitle$("Class", 0)') |
| ||
Hmm, but there could be more than one window with the same class. Maybe try GetForeGroundWindow and GetNextWindow ? |
| ||
you would need GetClassName() pass the hwnd pointer of the window whos classname to wish to obtain. woops maybe missunderstood, see FindWindowEx() this enables you to search all child windows of the passed parent hwnd, or you can start searching from child after using the second param |
| ||
After obtaining the handle of a window, how can you tell if it has been destroyed? |
| ||
Maybe enumerate all hwnds that are open, and see if the hwnd is in the list. |
| ||
pass hwnd to IsWindow() found in user32.dll, this determines whether the specified window handle identifies an existing window. |
| ||
That worked. Thanks a lot Kev. |
| ||
happy to help :) |