English
Source / code snippets

Browser Print Html Htmlwin Ocx Preview

 
Uwe ''Pascal'' Niemeier (10.03.11)

Hi people!

my Lösungsvorschlag ex XProfan 11.2 / XP:
CompileMarkSeparation
window %maxX,%maxY
appendmenubar 1,"Drucken mit Vorschau"
appendmenubar 2,"Drucken ohne Vorschau"
usermessages 16
 $H Windows.ph
 $H ocx3a.ph
 $I ocx3a.inc
ocxInit()
def %Exec 4
def &OLECMDID_PRINTPREVIEW 7
def $IID_OleCommandTarget "{b722bccb-4e68-101b-a2bc-00aa00404770}"
declare Document&,IOleCommandTarget&,Html$
declare WebBrowser&,WebControl&
Html$="C:\Test.html"
WebControl&=create("HTMLWin",%hwnd,Html$,1,0,0,width(%hwnd),height(%hwnd))
WebBrowser&=HTMLWin("QueryInterface",WebControl&)'--In Profan-Hilfe nicht dokumentiert!!
''--oder auch:
'Html$="C:\Test.html"
'WebBrowser&=ocxCreate(Html$,%hwnd,0,0,width(%hwnd),height(%hwnd),$50b00000,addr(WebControl&))

while 1

    waitinput
    case %umessage=16:break

    if %menuitem=1'-----------Drucken mit Vorschau über IOleCommandTarget

        IOleCommandTarget&=QueryInterface(WebBrowser&,$IID_OleCommandTarget)
        CallMethod(IOleCommandTarget&,%Exec,0,&OLECMDID_PRINTPREVIEW,0,var#,0)
        ocxRelease(IOleCommandTarget&)

    elseif %menuitem=2'-------Drucken ohne Vorschau über IHTMLDocument2

        Document&=ocxget(WebBrowser&,"Document")
        ocxMethod(Document&,"execCommand","print")
        ocxRelease(Document&)

    endif

endwhile

ocxRelease(WebBrowser&)
destroywindow(WebControl&)
ocxDeInitss=s2>()

SeeYou
Pascal
 
03/10/11  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.929 Views

Untitledvor 0 min.
Uwe Lang06/22/24
Sven Bader03/04/21
Torben Nissen01/27/21
p.specht12/21/20
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie