how to get application names? (and processes ?)

BlitzPlus Forums/BlitzPlus Programming/how to get application names? (and processes ?)

Andres(Posted 2010) [#1]
is there a way to get the titles of all the windows that are currently opened?

I have this code, but somewhy the hWndName value never changes though in userlibs there is just string format for that parameter. I've seen people using this same function, but with pointer to the string. How can i get it to work. It loops through hWnds just fine.
Const GW_HWNDNEXT = 2
Global hWndName% = ""

hWnd = api_GetTopWindow(api_GetDesktopWindow())
Repeat
	length% = api_GetWindowTextLength(hWnd) + 4
	val% = api_GetWindowText(hWnd, hWndName, length)
	DebugLog("WINDOW: " + hWndName)
	DebugLog("--- " + hWnd)
	
	hWnd = api_GetNextWindow(hWnd, GW_HWNDNEXT)
	Stop
	If hWnd = 0 Then Exit
Forever



Andres(Posted 2010) [#2]
Got it solved. One helpful person wrote me a DLL and it works perfectly now.