Skip to Content

Windows Media Player 11 in Delphi

Currently, I am working on a Delphi project that requires movie playing in the application. Obviously, the direct approach is to use the Windows Media Player ActiveX. However, when I imported the active X and try to resizing it at runtime, strange behavior starts to happen: the control does not obey my command. After googling around, it is that I have to directly call the SetObjectRects method directly. This could be done by the following codes.

procedure TGraphicController.resize;
const
    IID_IOleInPlaceObject: TGUID = '{00000113-0000-0000-C000-000000000046}';
var
  IOIPObj: IOleInPlaceObject;
begin
  inherited;
  IDispatch(wmp.OleObject).QueryInterface(IID_IOleInPlaceObject, IOIPObj);
  IOIPObj.SetObjectRects(adjustedRect, adjustedRect);
end;

The wmp is the Wrapper class of windows media player which is automatically generated and adjustedRect is the TRect structure that describe the location that I wish the control to be located at. The GUID of the interface can be found in http://msdn.microsoft.com/en-us/library/bb180708(VS.80).aspx.

Comments

test

test

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Allowed HTML tags: <pre> <span> <div> <p> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <hr> <div> <img> <blockquote> <pre> <br> <table> <tr> <td> <th> <thead> <tbody> <object> <param>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • LaTex commands embedded in text will be interpreted and rendered. Additional information can be found at DruTex Documentation Pages
    • Provides different environments to create rendered images (especially maths).
    • Line and paragraphs break automatically.
    • Assists automatic numbering of tex, equation, and equations environments.
    • Images can be added to this post.
    • Adds typographic refinements.

    More information about formatting options

    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.