Jump to content

bringing up the print applet


 Share

Recommended Posts

Hi

Anyone know how to bring up the print applet. For example the applet that comes up if you open a word doc and press ctrl p

MSDN PrintDlg and DllCall(). http://msdn.microsoft.com/library/default....ns/printdlg.asp

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

this sounds good but how do you run it?

well, it's a bit complicated. Study DllCall(), DllStructCreate() and the MSDN function.

BTW: What do you want to do? Maybe there is an easier way than this ....

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

First of all thanks for the reply

I have been looking at the examples that can be found here

http://msdn.microsoft.com/library/default....dialogboxes.asp

I have been trying to convert "Displaying the Print Dialog Box" to autoit. I have been looking at DLLCALL() on how to do this and i have come up with the below code. Am i on the right track any help would be great.

[/code]

$test = DllCall ("comdlg32.dll","PRINTDLG($pd)","PrintDlg"); [, "type1", param1 [, "type n", param n]] )

if ($test= TRUE) THEN
        // GDI calls to render output. 

        // Delete DC when done.
        $DeleteDC = DeleteDC(pd.hDC);
    EndIf


FUNC PRINTDLG($pd)
;HWND hwnd;
    // Initialize PRINTDLG
    ZeroMemory(&pd, sizeof(pd));
    $StructSize = pd.lStructSize = sizeof(pd);
    $hwndOwner = pd.hwndOwner   = hwnd;
    $hDevMode = pd.hDevMode = NULL;  // Don't forget to free or store hDevMode
    $hDevNames = pd.hDevNames   = NULL;  // Don't forget to free or store hDevNames
    $Flags = pd.Flags      = "PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC" 
    $nCopies = pd.nCopies    = 1;
    $nFromPage = pd.nFromPage   = 0xFFFF; 
    $nToPage = pd.nToPage    = 0xFFFF; 
    $nMinPage = pd.nMinPage = 1; 
    $nMaxPage = pd.nMaxPage = 0xFFFF; 

ENDFUNC
[code]
Link to comment
Share on other sites

I have been trying to convert "Displaying the Print Dialog Box" to autoit. I have been looking at DLLCALL() on how to do this and i have come up with the below code. Am i on the right track any help would be great.

O.K., but what are you going to do, as soon as the dialog shows up?

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Basically i want to lock down IE and creating my own menu bar which i have basically done. The thing missing is to open the print dialog box. the only pre-done one just send directly to your default printer which i don't want. I need the print applet that allow you to specify which printer you want to print to.

i have already done it (basically when you ask me if there was an eaiser method) by creating and exe with send ({CTRLDOWN} {P} {CTRLUP}) inside it and link a menu button to the exe. This works fine

However i would like to understand how to convert "Displaying the Print Dialog Box" into autoit via the dllcall() function. I don't really understand and i was just wondering if you would be so kind to give me an example.

Link to comment
Share on other sites

However i would like to understand how to convert "Displaying the Print Dialog Box" into autoit via the dllcall() function. I don't really understand and i was just wondering if you would be so kind to give me an example.

O.K. fine, you call PrintDlg(), but what are you going to do then?

When PrintDlg() returns, it sets some information in the structure (see below). What are you going to do with that information in AutoIT???

Do you think you can print the current wegpage with that? If so, then that's not the case. If you want to print a web page you have to send "CTRL-P" to the Internet Explorer window.

Parameters Parameters

lppd

[in, out] Pointer to a PRINTDLG structure that contains information used to initialize the dialog box. When PrintDlg returns, this structure contains information about the user's selections.

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...