Post by just me » 06 Mar 2018, 03:56
Es ist 'relativ einfach', den Dialog "Seite einrichten" aufzurufen. Es mag aber sein, dass Änderungen in diesem Dialog nur für das aufrufende Programm wirksam sind.
Code: Select all
#NoEnv
Result := PageSetupDlg()
MsgBox, 0, Result, %Result%
ExitApp
; ================================================================================================================================
; Page Setup Dialog Box
; msdn.microsoft.com/en-us/library/windows/desktop/ms646962(v=vs.85).aspx
; ================================================================================================================================
PageSetupDlg() {
Static PSD_DISABLEPRINTER := 0x00000020
, PSD_Size := (4 * 10) + (A_PtrSize * 11)
, OffFlags := 4 * A_PtrSize
VarSetCapacity(PSD, PSD_Size, 0) ; PAGESETUPDLG structure
NumPut(PSD_Size, PSD, 0, "UInt") ; lStructSize
NumPut(A_ScriptHwnd, PSD, A_PtrSize, "UPtr") ; hwndOwner
NumPut(PSD_DISABLEPRINTER, PSD, OffFlags, "Int") ; Flags
If !DllCall("Comdlg32.dll\PageSetupDlg", "Ptr", &PSD, "UInt")
Return False
DllCall("Kernel32.dll\GobalFree", "Ptr", NumGet(PSD, 2 * A_PtrSize, "UPtr"))
DllCall("Kernel32.dll\GobalFree", "Ptr", NumGet(PSD, 3 * A_PtrSize, "UPtr"))
Return True
}
Es ist 'relativ einfach', den Dialog "Seite einrichten" aufzurufen. Es mag aber sein, dass Änderungen in diesem Dialog nur für das aufrufende Programm wirksam sind.
[code]#NoEnv
Result := PageSetupDlg()
MsgBox, 0, Result, %Result%
ExitApp
; ================================================================================================================================
; Page Setup Dialog Box
; msdn.microsoft.com/en-us/library/windows/desktop/ms646962(v=vs.85).aspx
; ================================================================================================================================
PageSetupDlg() {
Static PSD_DISABLEPRINTER := 0x00000020
, PSD_Size := (4 * 10) + (A_PtrSize * 11)
, OffFlags := 4 * A_PtrSize
VarSetCapacity(PSD, PSD_Size, 0) ; PAGESETUPDLG structure
NumPut(PSD_Size, PSD, 0, "UInt") ; lStructSize
NumPut(A_ScriptHwnd, PSD, A_PtrSize, "UPtr") ; hwndOwner
NumPut(PSD_DISABLEPRINTER, PSD, OffFlags, "Int") ; Flags
If !DllCall("Comdlg32.dll\PageSetupDlg", "Ptr", &PSD, "UInt")
Return False
DllCall("Kernel32.dll\GobalFree", "Ptr", NumGet(PSD, 2 * A_PtrSize, "UPtr"))
DllCall("Kernel32.dll\GobalFree", "Ptr", NumGet(PSD, 3 * A_PtrSize, "UPtr"))
Return True
}[/code]