How can I print the dialog screen?
Or make a button than can.
How can I print a dialog box?
Moderators: JRL, Dorian (MJT support)
See if this works for you...
Code: Select all
Dialog>MyDialog
Caption=This is My Dialog
Width=312
Height=207
Top=150
Left=31
Button=Print Dialog Box,160,144,97,26,3
Button=Exit Macro,21,144,100,22,6
Label=This is a Dialog Box,8,8,true
Edit=msEdit1,8,56,121,msEdit1
EndDialog>MyDialog
Show>MyDialog
Label>MainLoop
GetDialogAction>myDialog,result
If>result=2,End
If>result=6,Close
If>result=3,myPrint
Wait>0.01
Goto>MainLoop
SRT>myPrint
GetActiveWindow>WinTitle,X1,Y1,myWidth,myHeight
Let>X2=X1+myWidth
Let>Y2=Y1+myHeight
ScreenCapture>X1,Y1,X2,Y2,%SCRIPT_DIR%\mytemp.bmp
Run>mspaint /p "%SCRIPT_DIR%\mytemp.bmp"
If>SCREENCAP_RESULT<>0
MessageModal>Error saving screen - errorcode - %SCREENCAP_RESULT%
Endif
ResetDialogAction>MyDialog
END>myPrint
SRT>Close
CloseDialog>MyDialog
Let>r=2
END>Close
Label>End
Thanks It worked, great idea...
Any idea on how to landskape the print so it can fit in one page.
[quote
="adroege"]See if this works for you...
[/quote]
Any idea on how to landskape the print so it can fit in one page.
[quote
="adroege"]See if this works for you...
Code: Select all
Dialog>MyDialog
Caption=This is My Dialog
Width=312
Height=207
Top=150
Left=31
Button=Print Dialog Box,160,144,97,26,3
Button=Exit Macro,21,144,100,22,6
Label=This is a Dialog Box,8,8,true
Edit=msEdit1,8,56,121,msEdit1
EndDialog>MyDialog
Show>MyDialog
Label>MainLoop
GetDialogAction>myDialog,result
If>result=2,End
If>result=6,Close
If>result=3,myPrint
Wait>0.01
Goto>MainLoop
SRT>myPrint
GetActiveWindow>WinTitle,X1,Y1,myWidth,myHeight
Let>X2=X1+myWidth
Let>Y2=Y1+myHeight
ScreenCapture>X1,Y1,X2,Y2,%SCRIPT_DIR%\mytemp.bmp
Run>mspaint /p "%SCRIPT_DIR%\mytemp.bmp"
If>SCREENCAP_RESULT<0>Error saving screen - errorcode - %SCREENCAP_RESULT%
Endif
ResetDialogAction>MyDialog
END>myPrint
SRT>Close
CloseDialog>MyDialog
Let>r=2
END>Close
Label>End
I have a similar question. For years I've been doing the adroege suggestion but rather than using paint I've used WordPad. The results are uncontrollable and often unusable. Then I end up using irfanview which has many command line options but needs to be purchased for non-home use.
My question:
Any possibility of getting a built in print function?
My question:
Any possibility of getting a built in print function?