Results 1 to 9 of 9

Thread: streetdeck using wmp

  1. #1
    Maximum Bitrate customaudioman's Avatar
    Join Date
    Oct 2005
    Location
    Maryland
    Posts
    712

    streetdeck using wmp

    im using the fusion brain with streetdeck to control the frontend by using the steering wheel controls. but I need to know if StreetDeck opens WMP and sends instructions to it that way, or if it uses the WMP dll and doesnt actually open WMP.

    If SD doesnt open WMP, then I need to find the class name of StreetDeck. any streetdeck team member know?

  2. #2
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    StreetDeck embends a WMP window. YOu can use SPY++ from microsoft to figure out whatever class names you want. The class name for the main StreetDeck window is not constant. The window caption is though.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  3. #3
    Maximum Bitrate customaudioman's Avatar
    Join Date
    Oct 2005
    Location
    Maryland
    Posts
    712
    Quote Originally Posted by god_of_cpu View Post
    StreetDeck embends a WMP window. YOu can use SPY++ from microsoft to figure out whatever class names you want. The class name for the main StreetDeck window is not constant. The window caption is though.
    yeah I download the spy++ to find the class name. the title in streetdeck is call ''streetdeck'' and the class name changed every time I would open streetdeck. I need a constant class name. Im not sure if the control in the fusion brain would work right.

  4. #4
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    I use the following code to find the StreetDeck window. Basically after finding a window with the right window caption, we then confirm it by looking at the name of the executable of the process it belongs to.


    Code:
    ::EnumWindows(&EnumMainWindows, (LPARAM)&m_hWndStreetDeck);
    Code:
    //***************************************************************************
    // --- In  : hWnd : A top-level window
    //			 lParam : Additioanl data (pointer to a CInstanceWindow object)
    // --- Out : 
    // --- Returns : Whether to continue iterating
    // --- Effect : This function is called for every top-level window
    //***************************************************************************
    BOOL CALLBACK EnumMainWindows(HWND hWnd, LPARAM lParam)
    {
    	TCHAR szTitle[12];	
    	GetWindowText(hWnd, szTitle, 12);
    
    	//If this is the right window title, lets look at the executale file name to confirm its 
    	//a StreetDeck instance and not just some other window with the same name
    	if (lstrcmp(szTitle, _T("StreetDeck")) == 0)
    	{
    		// We will search for a toplevel window of the specified instance
    		// Thiw window should be not-owned (to exclude dialogs) 
    		DWORD nWindowPID = 0;
    		HMODULE hMod = NULL;
    		TCHAR filename[MAX_PATH];
    		::GetWindowThreadProcessId(hWnd, &nWindowPID);
    
    		
    		HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, FALSE, nWindowPID);
    		if (hProcess == NULL)
    		{
    			DWORD dwError = GetLastError();
    			
    			//If we failed because of security rights, assume its vista and try to query for the the
    			//process name iwth limited information rights
    			if (dwError == ERROR_ACCESS_DENIED)
    			{
    				hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, nWindowPID);
    				DWORD dwLength = MAX_PATH;
    				if (GetProcessImageFileName(hProcess, filename, sizeof(filename)))
    				{
    					CString strFind = filename;
    					int iEndSlash = strFind.ReverseFind('\\');
    					if (iEndSlash > 0)
    						strFind = strFind.Right(strFind.GetLength() - iEndSlash - 1);
    					if (strFind.CompareNoCase(_T("StreetDeck.exe")) == 0)
    					{
    						*((HWND*) lParam) = hWnd;
    						CloseHandle(hProcess); 
    						return FALSE;
    					}
    				}
    			}
    		} else
    		{
    			if(GetModuleFileNameEx(hProcess, hMod, filename, sizeof(filename))) 
    			{ 
    				CString strFind = filename;
    		  		int iEndSlash = strFind.ReverseFind('\\');
    				if (iEndSlash > 0)
    				 	strFind = strFind.Right(strFind.GetLength() - iEndSlash - 1);
    				if (strFind.CompareNoCase(_T("StreetDeck.exe")) == 0)
    				{
    					*((HWND*) lParam) = hWnd;
    					CloseHandle(hProcess); 
    					return FALSE;
    				}
    			}
    
    			CloseHandle(hProcess); 
    		}
    	}
    
    	// ... Not found, keep on looking
    	return TRUE;
    }
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  5. #5
    Maximum Bitrate customaudioman's Avatar
    Join Date
    Oct 2005
    Location
    Maryland
    Posts
    712
    Quote Originally Posted by god_of_cpu View Post
    I use the following code to find the StreetDeck window. Basically after finding a window with the right window caption, we then confirm it by looking at the name of the executable of the process it belongs to.


    Code:
    ::EnumWindows(&EnumMainWindows, (LPARAM)&m_hWndStreetDeck);
    Code:
    //***************************************************************************
    // --- In  : hWnd : A top-level window
    //			 lParam : Additioanl data (pointer to a CInstanceWindow object)
    // --- Out : 
    // --- Returns : Whether to continue iterating
    // --- Effect : This function is called for every top-level window
    //***************************************************************************
    BOOL CALLBACK EnumMainWindows(HWND hWnd, LPARAM lParam)
    {
    	TCHAR szTitle[12];	
    	GetWindowText(hWnd, szTitle, 12);
    
    	//If this is the right window title, lets look at the executale file name to confirm its 
    	//a StreetDeck instance and not just some other window with the same name
    	if (lstrcmp(szTitle, _T("StreetDeck")) == 0)
    	{
    		// We will search for a toplevel window of the specified instance
    		// Thiw window should be not-owned (to exclude dialogs) 
    		DWORD nWindowPID = 0;
    		HMODULE hMod = NULL;
    		TCHAR filename[MAX_PATH];
    		::GetWindowThreadProcessId(hWnd, &nWindowPID);
    
    		
    		HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, FALSE, nWindowPID);
    		if (hProcess == NULL)
    		{
    			DWORD dwError = GetLastError();
    			
    			//If we failed because of security rights, assume its vista and try to query for the the
    			//process name iwth limited information rights
    			if (dwError == ERROR_ACCESS_DENIED)
    			{
    				hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, nWindowPID);
    				DWORD dwLength = MAX_PATH;
    				if (GetProcessImageFileName(hProcess, filename, sizeof(filename)))
    				{
    					CString strFind = filename;
    					int iEndSlash = strFind.ReverseFind('\\');
    					if (iEndSlash > 0)
    						strFind = strFind.Right(strFind.GetLength() - iEndSlash - 1);
    					if (strFind.CompareNoCase(_T("StreetDeck.exe")) == 0)
    					{
    						*((HWND*) lParam) = hWnd;
    						CloseHandle(hProcess); 
    						return FALSE;
    					}
    				}
    			}
    		} else
    		{
    			if(GetModuleFileNameEx(hProcess, hMod, filename, sizeof(filename))) 
    			{ 
    				CString strFind = filename;
    		  		int iEndSlash = strFind.ReverseFind('\\');
    				if (iEndSlash > 0)
    				 	strFind = strFind.Right(strFind.GetLength() - iEndSlash - 1);
    				if (strFind.CompareNoCase(_T("StreetDeck.exe")) == 0)
    				{
    					*((HWND*) lParam) = hWnd;
    					CloseHandle(hProcess); 
    					return FALSE;
    				}
    			}
    
    			CloseHandle(hProcess); 
    		}
    	}
    
    	// ... Not found, keep on looking
    	return TRUE;
    }
    so what is it then? Im confused

  6. #6
    Maximum Bitrate customaudioman's Avatar
    Join Date
    Oct 2005
    Location
    Maryland
    Posts
    712
    Quote Originally Posted by god_of_cpu View Post
    StreetDeck embends a WMP window. YOu can use SPY++ from microsoft to figure out whatever class names you want. The class name for the main StreetDeck window is not constant. The window caption is though.
    can I just use ''streetdeck'' as the class name?

  7. #7
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    The class name of the StreetDeck window is not "StreetDeck".

    You can just search for the window name of StreetDeck and it will work most of the time, but its not garunteed to be unique. Windows explorer will also have a window name of StreetDeck if you are browsing that folder.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  8. #8
    Maximum Bitrate customaudioman's Avatar
    Join Date
    Oct 2005
    Location
    Maryland
    Posts
    712
    How to I use the code above to find the class name? I need something that is constant.

  9. #9
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    Quote Originally Posted by customaudioman View Post
    How to I use the code above to find the class name? I need something that is constant.
    You don't, the class name is not constant. The code above searches through every window and compares the exe name that created it to the streetdeck executable.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

Similar Threads

  1. StreetDeck F.A.Q.s
    By RedGTiVR6 in forum StreetDeck
    Replies: 0
    Last Post: 04-16-2007, 11:55 AM
  2. Streetdeck Now Available for Purchase
    By god_of_cpu in forum StreetDeck
    Replies: 46
    Last Post: 01-02-2007, 10:58 AM
  3. DTS Music OK in WMP, too fast in StreetDeck
    By rmsk8r in forum StreetDeck
    Replies: 2
    Last Post: 12-22-2006, 10:20 PM
  4. Streetdeck!
    By TheLlama in forum Off Topic
    Replies: 37
    Last Post: 11-08-2006, 05:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •