ページ設定ダイアグラム表示          <TOP>


ページ設定のダイアログボックスを呼び出します。

PageSetupDlg ページ設定のダイアログボックスを作成

 

 

'================================================================
'= ページ設定ダイアグラム表示
'=    (PageSetupDlg.bas)
'================================================================
#include "Windows.bi"

Type POINTAPI
    x As Long
    y As Long
End Type

Type RECT
    Left   As Long
    Top    As Long
    Right  As Long
    Bottom As Long
End Type

Type PAGESETUPDLG
    lStructSize             As Long
    hwndOwner               As Long
    hDevMode                As Long
    hDevNames               As Long
    flags                   As Long
    ptPaperSize             As POINTAPI
    rtMinMargin             As RECT
    rtMargin                As RECT
    hInstance               As Long
    lCustData               As Long
    lpfnPageSetupHook       As Long
    lpfnPagePaintHook       As Long
    lpPageSetupTemplateName As Long
    hPageSetupTemplate      As Long
End Type

' ページ設定のダイアログボックスを作成
Declare Function Api_PageSetupDlg& Lib "comdlg32" Alias "PageSetupDlgA" (pPagesetupdlg As PAGESETUPDLG)

'================================================================
'=
'================================================================
Declare Function ShowPageSetupDlg() As Long
Function ShowPageSetupDlg() As Long
    Var PSD As PAGESETUPDLG
    PSD.lStructSize = Len(PSD)      '構造体サイズ
    PSD.hwndOwner = GethWnd         'オーナーウィンドウ設定
    PSD.hInstance = GethInst        'インスタンス設定
    PSD.flags = 0

    If Api_PageSetupDlg(PSD) Then
        ShowPageSetupDlg = 0
    Else
        ShowPageSetupDlg = -1
    End If
End Function

'================================================================
'=
'================================================================
Declare Sub Button1_on edecl ()
Sub Button1_on()
    Var Ret As Long

    Ret = ShowPageSetupDlg()
End Sub

'================================================================
'=
'================================================================
While 1
    WaitEvent
Wend
Stop
End