1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
public void afficherPDF()
{
oleControlSite = new OleControlSite(frame, SWT.NONE, "Shell.Explorer");
oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
oleAutomation = new OleAutomation(oleControlSite);
int[] rgdispid = oleAutomation.getIDsOfNames(new String[] { "Navigate" });
oleControlSite.doVerb(OLE.OLEIVERB_DISCARDUNDOSTATE);
if (oleControlSite.doVerb(OLE.OLEIVERB_SHOW) != OLE.S_OK)
System.out.println("Verb error!");
else
System.out.println("Verb ok!");
v = new Variant("C:/fichier.pdf");
oleAutomation.invoke(rgdispid[0], new Variant[] v});
System.out.println("invoke ok");
frame.setBounds(10,30, shell.getSize().x - 5, shell.getSize().y - 10);
frame.setVisible(true);
} |