|
-
Oct 8th, 2023, 03:56 AM
#1
Thread Starter
Fanatic Member
The modern print dialog issue after Windows 11 22H2 update
In Windows 11 22H2, Microsoft has replaced the legacy Print Dialog for all classic (win32) apps, e.g., Notepad, WordPad, Notepad++, etc., with a new dialog. Earlier, this dialog was available only for UWP apps (aka Store apps). Also, there is a new Print Queue dialog introduced in this version.
However, in the modern print dialog, the preview pane always shows “No preview available,” irrespective of the previewed file type. Furthermore, on some systems, the title bar reads “Printing from Win32 application” instead of the program’s name — e.g., Notepad++.
I got another big issue: when I click the Print button, my custom print preview window or whole app going in taskbar.
If I switch off by .UseEXDialog = False, then the print dialog is traditional style, everything is normal.
How to solve this problem if I keep this new style Dialog?
Last edited by DaveDavis; Oct 8th, 2023 at 04:00 AM.
-
Oct 8th, 2023, 04:43 AM
#2
Re: The modern print dialog issue after Windows 11 22H2 update
".UseEXDialog = False"
This seems to be a .NET question. If not, clarify how you're calling it from VB6.
-
Oct 8th, 2023, 05:44 AM
#3
Thread Starter
Fanatic Member
Re: The modern print dialog issue after Windows 11 22H2 update
 Originally Posted by fafalone
".UseEXDialog = False"
This seems to be a .NET question. If not, clarify how you're calling it from VB6.
Yes, I used .NET for testing.
I just test VB6, I am using Krool's class CommonDialog.cls by calling ShowPrinterEx, the print dialog is new style, but test OK without such issue.
Last edited by DaveDavis; Oct 8th, 2023 at 06:20 AM.
-
Oct 8th, 2023, 08:57 AM
#4
Re: The modern print dialog issue after Windows 11 22H2 update
Well if Krool's class works ok you can always try calling the API directly like it does instead of the .NET wrapper.
Or make the class into a DLL (Krool has a version in twinBASIC that supports x64).
-
Oct 9th, 2023, 08:09 AM
#5
Addicted Member
Re: The modern print dialog issue after Windows 11 22H2 update
An alternative (and definitive) solution to restore the Legacy Print Dialog
1. Type "cmd" select Run as administrator
Code:
reg add "HKCU\Software\Microsoft\Print\UnifiedPrintDialog" /v "PreferLegacyPrintDialog" /d 1 /t REG_DWORD /f
OR
2. Add to registry
Code:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog]
"PreferLegacyPrintDialog"=dword:00000001
Last edited by cliv; Oct 9th, 2023 at 08:18 AM.
-
Oct 9th, 2023, 06:55 PM
#6
Thread Starter
Fanatic Member
Re: The modern print dialog issue after Windows 11 22H2 update
 Originally Posted by cliv
An alternative (and definitive) solution to restore the Legacy Print Dialog
1. Type "cmd" select Run as administrator
Code:
reg add "HKCU\Software\Microsoft\Print\UnifiedPrintDialog" /v "PreferLegacyPrintDialog" /d 1 /t REG_DWORD /f
OR
2. Add to registry
Code:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog]
"PreferLegacyPrintDialog"=dword:00000001
In .NET, when I set bit .UseEXDialog = false, it also turns out a traditional style or run the exe file set "Run as Administrator".
Also in .NET, at least, in my application, the modern print dialog cause the 2nd (underlet) window goes to foreground and foreground(my application) goes to underlet when <Print> button is being clicked.
-
Oct 9th, 2023, 09:04 PM
#7
Thread Starter
Fanatic Member
Re: The modern print dialog issue after Windows 11 22H2 update
 Originally Posted by cliv
An alternative (and definitive) solution to restore the Legacy Print Dialog
1. Type "cmd" select Run as administrator
Code:
reg add "HKCU\Software\Microsoft\Print\UnifiedPrintDialog" /v "PreferLegacyPrintDialog" /d 1 /t REG_DWORD /f
OR
2. Add to registry
Code:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Print\UnifiedPrintDialog]
"PreferLegacyPrintDialog"=dword:00000001
Thanks, We can read/write registry by temporarily set the value to 1, after app called "old style" Print Dialog, then restore original registry setting in our program.
-
May 19th, 2024, 10:58 AM
#8
New Member
Re: The modern print dialog issue after Windows 11 22H2 update
 Originally Posted by DaveDavis
Thanks, We can read/write registry by temporarily set the value to 1, after app called "old style" Print Dialog, then restore original registry setting in our program.
HI
This preview line no longer advanced and stopped without continuing and it was impossible to print.
I used this line and perfectly now I can print from my VB6 APP also with 23H2 of windows11...
Code:
reg add "HKCU\Software\Microsoft\Print\UnifiedPrintDialog" /v "PreferLegacyPrintDialog" /d 1 /t REG_DWORD /f
If I wanted to restore the other mode how should I insert the line to re-enable "as WIN11 23H2 did before"?
probably with:
Code:
reg delete "HKCU\Software\Microsoft\Print\UnifiedPrintDialog" /v "PreferLegacyPrintDialog" /f
Thanks
Last edited by ApipApip; May 19th, 2024 at 11:13 AM.
-
May 19th, 2024, 07:26 PM
#9
Thread Starter
Fanatic Member
Re: The modern print dialog issue after Windows 11 22H2 update
Code:
bool bReginstryModified = ReadWriteReginstryForPrintDialogSetting();
DialogResult dialogResult = printDialog.ShowDialog();
if (bReginstryModified )
{
RestoreReginstryForLegacyPrintDialog();
}
private bool ReadWriteReginstryForPrintDialogSetting()
{
try
{
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\\\Microsoft\\\\Print\\\\UnifiedPrintDialog", true);
if (registryKey != null)
{
int num = Convert.ToInt32(registryKey.GetValue("PreferLegacyPrintDialog"));
if (num == 1)
{
registryKey.Close();
registryKey.Dispose();
registryKey = null;
return false;
}
}
else
{
registryKey = Registry.CurrentUser.CreateSubKey("SOFTWARE\\\\Microsoft\\\\Print\\\\UnifiedPrintDialog");
if (registryKey == null)
{
return false;
}
}
registryKey.SetValue("PreferLegacyPrintDialog", 1, RegistryValueKind.DWord);
registryKey.Close();
registryKey.Dispose();
registryKey = null;
return true;
}
catch
{
//
}
return false;
}
private void RestoreReginstryForLegacyPrintDialog()
{
try
{
RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\\\Microsoft\\\\Print\\\\UnifiedPrintDialog", true);
if (registryKey != null)
{
registryKey.SetValue("PreferLegacyPrintDialog", 0, RegistryValueKind.DWord);
registryKey.Close();
registryKey.Dispose();
registryKey = null;
}
}
catch
{
//
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|