Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

window command

The window command controls the display window. You can use this command to change the display characteristics of the window or provide a destination window for the driver to use in place of the default display window. Digital-video, and video-overlay devices recognize this command.

To send this command, call the mciSendString function with the lpszCommand parameter set as follows.


_stprintf_s(
  lpszCommand, 
  TEXT("window %s %s %s"), 
  lpszDeviceID, 
  lpszWindowFlags, 
  lpszFlags
); 

Parameters

lpszDeviceID

Identifier of an MCI device. This identifier or alias is assigned when the device is opened.

lpszWindowFlags

Flag for controlling the display window. The following table lists device types that recognize the window command and the flags used by each type.

ValueMeaningMeaning
digitalvideohandle hwnd state hidestate minimizestate restorestate showshow maximizedshow minimizedshow min noactiveshow nashow noactivateshow normaltext caption
overlayfixedhandle defaulthandle hwnd state hidestate iconicstate maximizedstate minimizestate minimizedstate no actionstate noactivatestate normalstate restorestate showshow maximizedshow minimizedshow min noactiveshow nashow noactivateshow normalstretchtext caption

 

The following table lists the flags that can be specified in the lpszWindowFlags parameter and their meanings.

ValueMeaning
fixedDisables stretching of the image.
handle defaultSpecifies that the device should set the display window back to the default window created during the open operation. For video-overlay devices, specifies that the device should create and manage its own destination window.
handle hwndSpecifies the handle of the destination window to use instead of the default window. The hwnd parameter contains the ASCII numeric equivalent of the window handle returned by the CreateWindow function. Two device instances can use the same window handle provided that each instance updates the video and image pixels in the window as if the other instance did not exist. When video output is disabled with setvideo "off", an update command will make the destination rectangle a solid color.
show maximizedMaximizes the destination window.
show min noactiveDisplays the destination window as an icon.
show minimizedMinimizes the destination window.
show naDisplays the destination window in its current state; the window that is currently active remains active.
show noactivateDisplays the destination window in its most recent size and position; the window that is currently active remains active.
show normalActivates and displays the destination window in its original size and position. (This is the same as the "state restore" flag.)
state hideHides the destination window.
state iconicDisplays the destination window as an icon.
state maximizedMaximizes the destination window.
state minimizeMinimizes the destination window and activates the top-level window in the window-manager's list.
state minimizedMinimizes the destination window.
state no actionDisplays the destination window in its current state. The window that is currently active remains active.
state noactivateDisplays the destination window in its most recent size and state. The currently active window remains active.
state normalActivates and displays the destination window in its original size and position.
state restoreActivates and displays the destination window in its original size and position.
state showShows the destination window.
stretchEnables stretching of the image.
text captionSpecifies the caption for the destination window. If this text contains embedded blanks, the entire caption must be enclosed in quotation marks. The default caption for the default window is blank.

 

lpszFlags

Can be "wait", "notify", or both. For digital-video devices, "test" can also be specified. For more information about these flags, see The Wait, Notify, and Test Flags.

Return Value

Returns zero if successful or an error otherwise.

Remarks

Video-overlay devices typically create and display a window when opened. If your application provides a window to the driver, your application is responsible for managing the messages sent to the window.

Because you can use the status command to retrieve the handle to the driver display window, you can also use the standard window manager functions (such as ShowWindow) to manipulate the window.

Examples

The following command displays and sets the caption for the "movie" playback window.

window movie text "Welcome to the Movies" state show

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

See also

MCI
MCI Command Strings
open
play
setvideo
update

 

 

Community Additions

ADD
Show:
© 2015 Microsoft