Jump to content


sergioamim

Member Since 17/12/2003
Offline Last Active 26/05/2004, 14:07
-----

Posts I've Made

In Topic: Material Sobre Sessions

01/01/2004, 04:59

<?php
/* Define o limite de tempo do cache em 5 minutos */
session_cache_expire (5);
session_start();
...
?>

é isso ai!!! até mais

| (y) |

In Topic: Material Sobre Sessions

01/01/2004, 04:36

vc pode colocar setTimeOut(JavaScript é esse nome) para executar "session_destroy" ou unset($_SESSION['nome_variável']);


ex.:setTimeOut(Termina_sessao(), 180000);


<?php session_destroy(); ?>

algo desse tipo ainda estou me familiarizando com o PHP certamente tem algo mais apropriado...

valeu (y)
quem tiver um código adequado post ai!!!

In Topic: Para Quem Quise Código De Boleto Itau

26/12/2003, 13:02

este é pago né?

In Topic: Dll De Impressão Do Ie!

22/12/2003, 14:04

link para esta assunto!!! (y)

In Topic: Dll De Impressão Do Ie!

22/12/2003, 14:03

The code that does all of the dirty work in the samples is implemented in a reusable class named CWebBrowserPrint. This is defined in the WebBrowserPrint.h and WebBrowserPrint.cpp files. This makes it easy to incorporate the ability to set custom print settings in any C++ application that is hosting the WebBrowser control. The public aspects of the class are shown below.


class CWebBrowserPrint
{
public:
   enum Orientation {
      OrientationUndefined,
      OrientationPortrait,
      OrientationLandscape };
   enum PrintRange {
      PrintRangeUndefined,
      PrintRangeAll,
      PrintRangePages,
      PrintRangeSelection };
   enum PrintFrames {
      PrintFramesUndefined,
      PrintFramesScreen,
      PrintFramesSelected,
      PrintFramesIndividually };

   void SetWebBrowser(IWebBrowser2* pWebBrowser);
   bool Print();
   bool ReadDlgSettings();
   CString GetPrinterName(ULONG lIndex);
   ULONG GetPrinterCount();
   CStrin GetDefaultPrinterName();

   // Page Setup dialog settings
   CString m_sPaperSize;
   CString m_sPaperSource;
   CString m_sHeader;
   CString m_sFooter;
   Orientation m_Orientation;
   float m_fLeftMargin;
   float m_fTopMargin;
   float m_fRightMargin;
   float m_fBottomMargin;

   // Print dialog settings
   CString m_sPrinterName;
   bool m_bPrintToFile;
   PrintRange m_PrintRange;
   ULONG m_lPrintRangePagesFrom;
   ULONG m_lPrintRangePagesTo;
   ULONG m_lCopies;
   bool m_bCollate;
   PrintFrames m_PrintFrames;
   bool m_bPrintLinks;
   bool m_bPrintLinkTable;
};

In the above code sample:

SetWebBrowser allows your application to pass in a pointer to the WebBrowser instance. Call SetWebBrowser, specifying NULL to release the reference.
ReadDlgSettings reads the settings in the Page Setup and Print dialog boxes into the data members.
Print writes the settings from the data members back into the Page Setup and Print dialog boxes and starts the printing process.
GetPrinterCount returns the number of printers that are defined on the system. This is valid after calling ReadDlgSettings.
GetDefaultPrinterName returns the name of the default printer, or an empty string if there is no default printer. You should verify that a default printer is available before calling ReadDlgSettings or Print as they will not function properly unless there is at least one printer defined.
GetPrinterName returns the name of a specified printer. Specify an integer from 0 to 1 minus the number returned by GetPrinterCount.
The data members are self-explanatory. They are valid after calling ReadDlgSettings. You can modify any of these values to set custom print settings and then call Print to print with your specified settings.
The CWebBrowserPrint class installs a system hook with thread scope. The hook is only active from the ReadDlgSettings and Print functions. ReadDlgSettings installs the hook, calls ExecWB to invoke the Page Setup and Print dialog boxes, reads the dialog box settings into the class data members, clicks Cancel to dismiss the dialog boxes, and then removes the hook. Print installs the hook, calls ExecWB to invoke the Page Setup and Print dialog boxes, and transfers the changes from the class data members back to the dialog box. Print then prints the Web page, clicks OK to dismiss the dialog boxes, and then removes the hook.
Here is some sample code to illustrate how to use the class in an application. Note that we are checking to make sure there is a default printer before calling ReadDlgSettings or Print.

CWebBrowserPrint wbp;
if (_tcslen(wbp.GetDefaultPrinterName()))
{
    wbp.SetWebBrowser(pWebBrowser);
    wbp.ReadDlgSettings();
    wbp.m_sHeader = _T("My Header");
    wbp.m_Orientation = CWebBrowserPrint::Landscape;
    wbp.Print();
}

The phookctl sample exposes the printer settings from an ActiveX control. This gives you the ability to set custom print settings from script in a Web page as shown below.


<HTML>
<HEAD>
<OBJECT ID="wbp"
CLASSID="CLSID:778C58A9-81B6-11D3-BB8F-00C04FA3471C">
</OBJECT>
<script LANGUAGE="VBScript">
    Sub Print()
        If Len(wbp.DefaultPrinterName) = 0 Then
            MsgBox "No default printer!"
            Exit Sub
        End If
        wbp.Header = "My Header"
        wbp.Orientation = 2 ' Landscape
        wbp.Print
    End Sub
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE="BUTTON" VALUE="Print" ONCLICK="Print()">
</BODY>
</HTML>
Note that there is no need to call SetWebBrowser or ReadDlgSettings when using this control on a Web page, because the control can obtain this information on its own. However, SetWebBrowser is exposed so you can set the reference when hosting the WebBrowser control in your own application.

Lastly, the phookvb sample demonstrates using phookctl in a VB application that hosts the WebBrowser control.

IPB Skin By Virteq