View Single Post
  #8 (permalink)  
Old 31st July 2004
bst's Avatar
bst bst is offline
BS.Developer
BS.Player Power User
 
Join Date: Jun 2002
Posts: 181
Rep Power: 10
bst will become famous soon enoughbst will become famous soon enough
Default

This should work.
You can call it
$dll(DLLNAME.dll, GetBSPMovieName, 0) and you will get full path
or
$dll(DLLNAME.dll, GetBSPMovieName, 1) for filename without path.

Code:
int __stdcall GetBSPMovieName(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
{

	HWND bsp_hand;
	if ( (bsp_hand = FindWindow("BSPlayer",NULL)) !=0 ) {
		COPYDATASTRUCT cds;

		char buf[MAX_PATH];
		void *adr;
		adr=&buf;

		cds.dwData=BSP_GetFileName;
		cds.lpData=&adr;
		cds.cbData=4;
		SendMessage(bsp_hand,WM_COPYDATA,(WPARAM)aWnd,(LPARAM)&cds);

		if (strcmp(data,"0")==0) 
			strcpy(data, buf);
		else
		{
			char *p=strrchr(buf,'\\');
			strcpy(data, ++p);
		}

		return 3;
	}

	return 1;

}
Reply With Quote
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20