开发者

how to launch Print dialog from application as like from word pad in wince

I am trying to launch default print dialog from application , but it is not coming up. I am able to launc print dialog from wordpad application it is also printing the decument but, when i am trying to do the same nothing 开发者_StackOverflowis happn. here is code for show print dialog:-

PAGESETUPDLG printDialog;

ZeroMemory(&printDialog, sizeof(printDialog)); 

printDialog.lStructSize = sizeof(printDialog); 

printDialog.hwndOwner = NULL; //or = NULL  

PageSetupDlg(&printDialog);

pls tell me how to achive this...

regards,

Mukesh


The code you posted runs fine in a test app I knocked up, so technically there's nothing wrong with the code.

If you specify the hwndOwner as NULL, as in your example code, the print dialog opens as a modeless dialog, which could be opening behind your application's GUI - your code may therefore be correctly opening the dialog, you're just not seeing it. As a modeless dialog doesn't stop you interacting with the window that spawned it, you would be able to fully interact with your main GUI, not realising the print dialog is sitting behind it.

Can you not specify the hwndOwner? It should really be the handle of the window that's opening the print dialog, so that, as I mention above, it stops the user interacting with the main window whilst the printer settings are configured.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜