-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add PD and PD_RESULT enums in Interop Comdlg32 #2594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Comdlg32 | ||
{ | ||
[Flags] | ||
public enum PD : uint | ||
{ | ||
ALLPAGES = 0x00000000, | ||
SELECTION = 0x00000001, | ||
PAGENUMS = 0x00000002, | ||
NOSELECTION = 0x00000004, | ||
NOPAGENUMS = 0x00000008, | ||
COLLATE = 0x00000010, | ||
PRINTTOFILE = 0x00000020, | ||
PRINTSETUP = 0x00000040, | ||
NOWARNING = 0x00000080, | ||
RETURNDC = 0x00000100, | ||
RETURNIC = 0x00000200, | ||
RETURNDEFAULT = 0x00000400, | ||
SHOWHELP = 0x00000800, | ||
ENABLEPRINTHOOK = 0x00001000, | ||
ENABLESETUPHOOK = 0x00002000, | ||
ENABLEPRINTTEMPLATE = 0x00004000, | ||
ENABLESETUPTEMPLATE = 0x00008000, | ||
ENABLEPRINTTEMPLATEHANDLE = 0x00010000, | ||
ENABLESETUPTEMPLATEHANDLE = 0x00020000, | ||
USEDEVMODECOPIES = 0x00040000, | ||
USEDEVMODECOPIESANDCOLLATE = 0x00040000, | ||
DISABLEPRINTTOFILE = 0x00080000, | ||
HIDEPRINTTOFILE = 0x00100000, | ||
NONETWORKBUTTON = 0x00200000, | ||
CURRENTPAGE = 0x00400000, | ||
NOCURRENTPAGE = 0x00800000, | ||
EXCLUSIONFLAGS = 0x01000000, | ||
USELARGETEMPLATE = 0x10000000 | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Comdlg32 | ||
{ | ||
public enum PD_RESULT | ||
{ | ||
CANCEL = 0, | ||
PRINT = 1, | ||
APPLY = 2 | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -374,35 +374,7 @@ public static uint MAKELCID(uint lgid, uint sort) | |
NM_CUSTOMDRAW = ((0 - 0) - 12), | ||
NM_RELEASEDCAPTURE = ((0 - 0) - 16); | ||
|
||
public const int PD_ALLPAGES = 0x00000000, | ||
PD_SELECTION = 0x00000001, | ||
PD_PAGENUMS = 0x00000002, | ||
PD_NOSELECTION = 0x00000004, | ||
PD_NOPAGENUMS = 0x00000008, | ||
PD_COLLATE = 0x00000010, | ||
PD_PRINTTOFILE = 0x00000020, | ||
PD_PRINTSETUP = 0x00000040, | ||
PD_NOWARNING = 0x00000080, | ||
PD_RETURNDC = 0x00000100, | ||
PD_RETURNIC = 0x00000200, | ||
PD_RETURNDEFAULT = 0x00000400, | ||
PD_SHOWHELP = 0x00000800, | ||
PD_ENABLEPRINTHOOK = 0x00001000, | ||
PD_ENABLESETUPHOOK = 0x00002000, | ||
PD_ENABLEPRINTTEMPLATE = 0x00004000, | ||
PD_ENABLESETUPTEMPLATE = 0x00008000, | ||
PD_ENABLEPRINTTEMPLATEHANDLE = 0x00010000, | ||
PD_ENABLESETUPTEMPLATEHANDLE = 0x00020000, | ||
PD_USEDEVMODECOPIES = 0x00040000, | ||
PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000, | ||
PD_DISABLEPRINTTOFILE = 0x00080000, | ||
PD_HIDEPRINTTOFILE = 0x00100000, | ||
PD_NONETWORKBUTTON = 0x00200000, | ||
PD_CURRENTPAGE = 0x00400000, | ||
PD_NOCURRENTPAGE = 0x00800000, | ||
PD_EXCLUSIONFLAGS = 0x01000000, | ||
PD_USELARGETEMPLATE = 0x10000000, | ||
PRF_CHECKVISIBLE = 0x00000001, | ||
public const int PRF_CHECKVISIBLE = 0x00000001, | ||
PRF_NONCLIENT = 0x00000002, | ||
PRF_CLIENT = 0x00000004, | ||
PRF_ERASEBKGND = 0x00000008, | ||
|
@@ -565,11 +537,6 @@ public const int | |
|
||
public static int START_PAGE_GENERAL = unchecked((int)0xffffffff); | ||
|
||
// Result action ids for PrintDlgEx. | ||
public const int PD_RESULT_CANCEL = 0; | ||
public const int PD_RESULT_PRINT = 1; | ||
public const int PD_RESULT_APPLY = 2; | ||
|
||
private static uint wmMouseEnterMessage = uint.MaxValue; | ||
|
||
public static User32.WindowMessage WM_MOUSEENTER | ||
|
@@ -724,7 +691,7 @@ public interface PRINTDLG | |
IntPtr hDevNames { get; set; } | ||
IntPtr hDC { get; set; } | ||
|
||
int Flags { get; set; } | ||
Comdlg32.PD Flags { get; set; } | ||
|
||
short nFromPage { get; set; } | ||
short nToPage { get; set; } | ||
|
@@ -757,8 +724,6 @@ public class PRINTDLG_32 : PRINTDLG | |
IntPtr m_hDevNames; | ||
IntPtr m_hDC; | ||
|
||
int m_Flags; | ||
|
||
short m_nFromPage; | ||
short m_nToPage; | ||
short m_nMinPage; | ||
|
@@ -784,7 +749,7 @@ public class PRINTDLG_32 : PRINTDLG | |
public IntPtr hDevNames { get { return m_hDevNames; } set { m_hDevNames = value; } } | ||
public IntPtr hDC { get { return m_hDC; } set { m_hDC = value; } } | ||
|
||
public int Flags { get { return m_Flags; } set { m_Flags = value; } } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. automatic properties must be avoided in interop since you don't control the binary layout anymore [edit] made the comment on the wrong side of the diff, this line got replaced by an automatic property |
||
public Comdlg32.PD Flags { get; set; } | ||
|
||
public short nFromPage { get { return m_nFromPage; } set { m_nFromPage = value; } } | ||
public short nToPage { get { return m_nToPage; } set { m_nToPage = value; } } | ||
|
@@ -817,8 +782,6 @@ public class PRINTDLG_64 : PRINTDLG | |
IntPtr m_hDevNames; | ||
IntPtr m_hDC; | ||
|
||
int m_Flags; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fields cannot be moved around There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, should have picked that! 🤦♂ |
||
|
||
short m_nFromPage; | ||
short m_nToPage; | ||
short m_nMinPage; | ||
|
@@ -844,7 +807,7 @@ public class PRINTDLG_64 : PRINTDLG | |
public IntPtr hDevNames { get { return m_hDevNames; } set { m_hDevNames = value; } } | ||
public IntPtr hDC { get { return m_hDC; } set { m_hDC = value; } } | ||
|
||
public int Flags { get { return m_Flags; } set { m_Flags = value; } } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use automatic properties since you cannot control the binary layout [edit] made the comment on the wrong side of the diff, this line got replaced by an automatic property |
||
public Comdlg32.PD Flags { get; set; } | ||
|
||
public short nFromPage { get { return m_nFromPage; } set { m_nFromPage = value; } } | ||
public short nToPage { get { return m_nToPage; } set { m_nToPage = value; } } | ||
|
@@ -875,7 +838,7 @@ public class PRINTDLGEX | |
public IntPtr hDevNames; | ||
public IntPtr hDC; | ||
|
||
public int Flags; | ||
public Comdlg32.PD Flags; | ||
public int Flags2; | ||
|
||
public int ExclusionFlags; | ||
|
@@ -900,8 +863,7 @@ public class PRINTDLGEX | |
public IntPtr lphPropertyPages; | ||
|
||
public int nStartPage; | ||
public int dwResultAction; | ||
|
||
public Comdlg32.PD_RESULT dwResultAction; | ||
} | ||
|
||
// x86 requires EXPLICIT packing of 1. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields cannot be moved around