Access to SlideShowWindow.HWND mystery

Add-in Express™ Support Service
That's what is more important than anything else

Access to SlideShowWindow.HWND mystery
 
Chris Bowman




Posts: 15
Joined: 2005-02-15
Hi,

In powerpoint I am using the onSlideShowBegin event defined as:

procedure onSlideShowBegin(Sender: TObject; {Flags(3), (1/1) CC:4, INV:1, DBG:9}var {VT_29:1}Wn: OleVariant);

I want to get the handle of the new slideshow window but I have a problem...

I can get access to the handle using following code successfully:
Application.Slideshowwindows.Item(1).HWND

BUT
Wn.HWND
Gives a runtime exception 'Member not found'.

To check that I'm not doing anything stupid I have checked '.height' instead of '.hwnd' and both statements work fine.

Can anybody help?

Chris
Posted 20 May, 2005 11:04:08 Top
Dmitry Kostochko


Add-in Express team


Posts: 2742
Joined: 2004-04-05
Hi Chris,

It seems you have Delphi 5. Try the code below.


procedure TAddInModule.onSlideShowBegin(Sender: TObject; var Wn: OleVariant);
var
  WHandle: HWND;
  IWnd: SlideShowWindow;
begin
  IWnd := IDispatch(TVarData(Wn).VDispatch) as SlideShowWindow;
  WHandle := IWnd.HWND;
  //...
end;


Posted 20 May, 2005 11:48:35 Top
Chris Bowman




Posts: 15
Joined: 2005-02-15
Dmitry,

You've done it again! I should have posted this hours ago :cry:

Thanks

Chris
Posted 20 May, 2005 11:53:05 Top
Dmitry Kostochko


Add-in Express team


Posts: 2742
Joined: 2004-04-05
Chris,

You are always welcome.
Posted 20 May, 2005 12:00:01 Top