共用方式為


IDeviceEmulatorManager::ShowManagerUI

更新:2007 年 11 月

會顯示或隱藏 [裝置模擬器管理員] 視窗。

HRESULT ShowManagerUI([in] BOOL fShow);

參數

  • [in] fShow
    表示要顯示或隱藏 [裝置模擬器管理員] 視窗。設定為 true 則會顯示視窗,false 則會隱藏視窗。

傳回值

HRESULT 值,表示方法呼叫的結果。

範例

這個範例會依序啟動、顯示及隱藏 [裝置模擬器管理員] 視窗。

int _tmain(int argc, _TCHAR* argv[])
{
    if (SUCCEEDED(CoInitializeEx(NULL, COINIT_MULTITHREADED)))
    {
        // HRESULT is used to determine whether method calls are successful
        HRESULT hr;

        // Instantiate DeviceEmulatorManager (DEM) object.
        // This starts DvcEmuManager.exe in silent mode

        CComPtr<IDeviceEmulatorManager> pDeviceEmulatorManager;
        hr = pDeviceEmulatorManager.CoCreateInstance(__uuidof(DeviceEmulatorManager));
        if (FAILED(hr)) {
            wprintf_s(L"Error: Unable to instantiate DeviceEmulatorManager. ErrorCode=0x%08X\n", hr);
            return false;
        }

        // Show the window.
        hr = pDeviceEmulatorManager->ShowManagerUI(true);
        system("pause");

        // Hide the window.
        pDeviceEmulatorManager->ShowManagerUI(false);
        system("pause");

        return true;
        CoUninitialize();
    }
    return 0;
}

需求

DEMComInterface.tlb