Sign in to follow this  
Adam_42

Alt-tab not minimizing game after initializing movie player

Recommended Posts

I've found that after calling this function my game will no longer minimize when alt-tab is pressed. This is on both ATI and Nvidia cards under XP. On Vista alt-tab still works after calling the function. Note that you'll need a reasonably recent platform SDK to get this to compile. It probably won't return true or cause problems unless you have media player 10 or newer installed too. Any suggestions on how to make alt-tab work again after calling this code would be appreciated.
#include <vmr9.h>
#include <d3d9.h>
#include <atlbase.h>
#include <comutil.h>
#include <dshow.h>

bool BreakAltTab(void)
{
    IBaseFilter* pBF = NULL;
    HRESULT hr = CoCreateInstance(CLSID_VideoMixingRenderer9, NULL,
                          CLSCTX_INPROC,
                          IID_IBaseFilter,
                          (LPVOID *)&pBF);
    if(SUCCEEDED(hr))
    {
        pBF->Release();
        return true;
    }
    else
    {
        return false;
    }
}


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this