Last Updated 2013/05/12
Programming Tips Windows  索 引 
セカンドモニターへの表示
2013/05/12

    POINT stSecondS;

    
    // ここにセカンドディスプレイの座標を設定する
    
    stSecondS.x = -100;
    stSecondS.y = 0;

    HMONITOR hSecondS;
    hSecondS = MonitorFromPoint( stSecondS, MONITOR_DEFAULTTONEAREST );

    STARTUPINFO si;
    ZeroMemory(&si,sizeof(si));
    si.cb=sizeof(si);
    si.dwFlags = 0x400;
    si.hStdOutput = hSecondS;

    CreateProcess(strFlashFile, NULL
                    , NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);

dwFlags に設定する値はドキュメント化されていないけど,以下のものがある。

STARTF_USEHOTKEY 0x200 Use the hot-key DWORD specified in the hStdInput member.
STARTF_MONITOR 0x400 Use the HMONITOR handle specified in the hStdOutput member.
STARTF_ICON 0x400 Use the HICON specified in the hStdOutput member (incompatible with STARTF_MONITOR)
STARTF_TITLESHORTCUT 0x800 Program was started through a shortcut. The lpTitle contains the shortcut path.
STARTF_SCREENSAVER 0x80000000 Start the program with NORMAL_PRIORITY, then drop to IDLE_PRIORITY.


参照
前後のTips
セカンドモニターへの表示

DSS ProgrammingTipsCGI Ver2.02