Code:
	case WM_COMMAND:
		{
			if(LOWORD(wParam) == BN_CLICKED && (HWND)lParam == hbtnGetHandle)
			{
				char * caption = ""; 
				caption = (char *)GetWindowText(htxtGetWindow,
							(LPTSTR) caption, 25);
				new_hwnd = FindWindow(NULL, (LPCTSTR)caption);
			}
		}
		break;
There is something wrong here. It does not seem to create a handle from the caption of the app the user entered. I don't think the type-casts i made are right. Can anyone please help me fix that Thanks