• 0

C#, C++ help to catch filename


Question

I have couple of years of experience with C# and C++, making database programs and so on but I would need to make a simple DLL for use in Windows Media Center and I got no clue on how to do some things I would need. Sorry english is not my native language so i need to explain this the long way.

I would need to know what happens when I click play on Windows Media Center movie library (Blu-ray or MKV). When I click play WMC loads the DLL but the problem is how to make the DLL catch the information from WMC when clicked play, like the filename of the file.

For example Total Media Theatre has a WMC plugin, a registry key that tells WMC to load TMT WMC plugin DLL when trying to play BD and the DLL catches the filename and launches the file in TMT on top of WMC.

Here's all I could find about this, it has everything except no info about the DLL part, how to pass the filename to external player.

http://msdn.microsof...p/bb189523.aspx

With the samples above WMC opens the external player by sendiong it it command for example "C:\player.exe" the dll would need to send the command "C:\player.exe G:\" for example.

Link to comment
https://www.neowin.net/forum/topic/1120878-c-c-help-to-catch-filename/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

On TMT it works like this. On registry, instead of directly to player they specify a .HTM file (along with the htm they have playerloader.dll):


<html>
<head>
<title>TotalMedia Theatre</title>
<script>
function GetArgument(ji)
{
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i = 0; i < gy.length; i++)
{
ft = gy[i].split("=");
if (ft[0] == ji) { return ft[1]; }
}
return null;
}
function GetPlayerCommandLine()
{
var path = null;
var filePath = null;
try
{
path = GetArgument("uri");
if (path == null) path = window.external.MediaCenter.MediaContext.GetProperty("Name");
}
catch (e) { path = window.location.search.substring(1); }

var i = path.indexOf("///");
if(i == -1) i = path.indexOf("//");
else i = i + 3;
filePath = path.substring(i);
if (path.indexOf("dvd") != -1 && filePath.length <= 3) {
var tempString;
if (filePath.charAt(2) == '/') tempString = filePath.substring(0, 2);
filePath = tempString + "\\";
}
return filePath;
}
function IsMCEEnabled()
{
return true;
}
function ReEnterDirectXExclusiveMode()
{
return false;
}
function OnLoad()
{
var dxExclusive = false;

try
{
window.external.MediaCenter.DirectXExclusive = false;
dxExclusive = window.external.MediaCenter.DirectXExclusive;
}
catch (e) { LaunchPlayer(); }
if (dxExclusive == true) setTimeout(OnLoad, 100);
else { LaunchPlayer(); }
}
function OnUnload()
{
try { PlayerLoader4.UnloadPlayer(); }
catch (e) { }
}
function GoBack()
{
PlayerLoader4.UnloadPlayer();
try { window.external.MediaCenter.CloseApplication(); }
catch (e) { }
}
function LaunchPlayer()
{
try
{
var comActiveX = new ActiveXObject("PlayerLoader4.PlayerLoader4Ctrl.32");
delete comActiveX;
document.body.innerHTML = '<object id="PlayerLoader4" width="100%" height="100%" classid="clsid:b1e62c80-95a6-49c1-8806-b43e6a4f3742"></object>';
}
catch (e)
{
document.body.innerHTML = '<object id="PlayerLoader4" width="100%" height="100%" classid="clsid:7ae2296c-ad65-4dbc-9413-96c5853418a7"></object>';
}
var filePath = GetPlayerCommandLine();
try { PlayerLoader4.GetCmdLine(GetPlayerCommandLine()); }
catch (e) { }
PlayerLoader4.LoadPlayer();
}

</script>
<style type="text/css">
* { margin: 0px; padding: 0px; }
</style>
</head>
<body bgcolor="#004080" onload="OnLoad();" onunload="OnUnload();" scroll="no">
</body>
</html>

[/CODE]

  • 0

How does this work? I think this starts something from the .dll file which then loads the player exe. b1e62c80-95a6-49c1-8806-b43e6a4f3742 below is the dll file, dunno what 7ae2296c-ad65-4dbc-9413-96c5853418a7 is as there was no occurences on the registry. I don't understand how this starts anything from the dll.


function LaunchPlayer()
{
try
{
var comActiveX = new ActiveXObject("PlayerLoader4.PlayerLoader4Ctrl.32");
delete comActiveX;
document.body.innerHTML = '<object id="PlayerLoader4" width="100%" height="100%" classid="clsid:b1e62c80-95a6-49c1-8806-b43e6a4f3742"></object>';
}
catch (e)
{
document.body.innerHTML = '<object id="PlayerLoader4" width="100%" height="100%" classid="clsid:7ae2296c-ad65-4dbc-9413-96c5853418a7"></object>';
}
var filePath = GetPlayerCommandLine();
try { PlayerLoader4.GetCmdLine(GetPlayerCommandLine()); }
catch (e) { }
PlayerLoader4.LoadPlayer();
}
[/CODE]

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Simple answer is yes, you will still get the Windows updates and as long as browser is up to date, you will be good. Only thing secure boot does is protect you against boot level threats and make it harder to install other OS's. I've been looking into this pretty thoroughly lately myself as wifes computer has secure boot disabled plus my other, older computers that run Linux, don't have secure boot enabled. Have seen all kinds of questions about this on the Linux Mint and MX Linux forums. Just don't suddenly enable secure boot now.
    • How many other companies will follow Ford's lead? Or, have they already gotten lazy and become enslaved to AI--and now can't figure out how to get out of that mess.
    • Why would any self-respecting intelligent person follow any recommendation by Donald's GOP administration? With almost two years of fabrications, deceit, and blatantly illegal behavior, why believe them now? They had best be gone after the November 2026 election, so we'll wait and see.
    • AltSendme 0.4.1 by Razvan Serea AltSendme is a minimal, cross-platform application designed for fast, secure, and private peer-to-peer file transfers. It allows users to send files or entire directories directly between devices without relying on cloud servers, accounts, or any personal information. Everything is encrypted end-to-end using modern protocols like QUIC and TLS 1.3, ensuring both strong security and low-latency performance. Transfers are verified with BLAKE3 for data integrity, and interrupted downloads automatically resume, making the experience reliable even on unstable connections. You can transfer anything—images, videos, documents, and more. Integrity checks are performed on both ends, so your files are automatically verified for correctness during both sending and receiving. AltSendme works seamlessly across local networks or long-distance links, capable of saturating multi-gigabit connections for extremely fast delivery. With built-in NAT traversal and encrypted relay fallback, it connects devices almost anywhere. The app integrates with the Sendme CLI and will soon support mobile and web platforms. Fully free and open-source, AltSendme offers a lightweight, privacy-first alternative to traditional cloud-based services, removing size limits, upload costs, and unnecessary data exposure. AltSendme 0.4.1 changelog: Release Highlights Self-hosted relays: Run your own iroh relay so transfers don't rely on public infrastructure. Includes a full deployment template in deploy/relay/ with Docker Compose for a VPS and configuration examples for production use. Fly.io support: One-click deploy template for Fly.io, including a quick-start config (fly.dev.toml) for testing without a custom domain, plus production setup with Let's Encrypt and your own hostname. Relay settings UI: New Settings → Network panel to choose how AltSendme connects: automatic public relays, custom self-hosted URLs (with optional auth token), or disabled. Test connections, verify latency, and see live relay status in the footer. Disable relays: Turn off relay servers entirely when you only need same-network transfers (e.g. LAN). Direct connections only. No relay hop required when devices can reach each other. Android graduates from beta: Android is now part of the regular release cycle alongside desktop. APKs ship with each version (universal, arm64, and armv7). Other improvements Private relay access control via shared auth token Relay fallback notifications when a custom relay is unreachable Broadcast mode toggle in sharing settings Android release build fixes (split-per-ABI APKs, universal APK preservation) UI polish: mobile safe-area insets, dropzone layout, transfer progress animation Bug fixes for minification-related serialization issues and system tray icon loading What's Changed feat(relay): add relay status functionality and settings UI (a120cdf) feat(relay): implement custom relay server configuration and verification (51276c7) feat(relay): add configuration for private relay access and enhance observability features (48fbabf) feat(relay): enhance relay URL validation, display connection status (d4fffa0) feat(relay): add RelayChangeGuard component and enhance relay-related translations (16ba514) feat(broadcast): add toggle setting for broadcast mode in sharing UI (ca6d977) fix(relay): correct QUIC discovery port, pin image, templatize fly.dev (52a2ba5) fix: More broken serialization due to minification (67491a9) fix(android): preserve true universal APK across per-ABI builds (e9f256f) fix(ui): conditional safe-area insets padding on mobile (1182f0e) refactor(transfer): CircularRing component animation fix (944572b) chore(android): drop x86 and x86_64 release APKs, keep universal+arm64+armv7 (34ada0b) Download: AltSendme 0.4.1 | ARM64 | ~9.0 MB (Open Source) Download: AltSendme for MacOS | Android Links: AltSendme Home Page | GitHub | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • You are mostly right about the ephemeral nature of it. As I mention in the article, if you dont add a second device or take a backup of your account before uninstalling it, then yes you will lose access to your account. That said, in terms of actual user experience when you sync multiple devices your message history carries across and there's also a Saved Messages chat like there is on Telegram to send messages and attachments between your installs. But yh, what you point out are correct and its not trying to emulate Messenger or Telegram.
  • Recent Achievements

    • Week One Done
      flexorcist earned a badge
      Week One Done
    • One Month Later
      Woland13 earned a badge
      One Month Later
    • Week One Done
      Woland13 earned a badge
      Week One Done
    • One Year In
      bernmeister earned a badge
      One Year In
    • Week One Done
      Scoobystu earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      495
    2. 2
      +Edouard
      225
    3. 3
      PsYcHoKiLLa
      149
    4. 4
      Steven P.
      75
    5. 5
      FloatingFatMan
      71
  • Tell a friend

    Love Neowin? Tell a friend!