[파워빌더] 해상도 변환
[Local external function declaration]
FUNCTION long ChangeDisplaySettingsA (ref devmode lpst, ulong Flags) &
LIBRARY "USER32.DLL"
[structure definition, devmode]
character dmdevicename[32]
integer dmspecversion
integer dmdriverversion
integer dmsize
integer dmdriverextra
long dmfields
integer dmorientation
integer dmpapersize
integer dmpaperlength
integer dmpaperwidth
integer dmscale
integer dmdefaultsource
integer dmprintquality
integer dmcolor
integer dmduplex
integer dmresolution
integer dmttoption
integer dmcollate
character dmformname[32]
integer dmlogpixels
long dmbitsperpel
long dmpelswidth
long dmpelsheight
long dmdisplayflags
long dmdisplayfrequency
long dmicmmethod
long dmicmintent
long dmmediatype
long dmdithertype
long dmreserved1
long dmreserved2
[Instance variable declaration]
Ulong CDS_FORCE = 8*16*16*16*16*16*16*16
long DM_BITSPERPEL_H = 4*16*16*16*16
long DM_PELSWIDTH_H = 8*16*16*16*16
long DM_PELSHEIGHT_H = 16*16*16*16*16
long DM_DISPLAYFLAGS_H = 2*16*16*16*16*16
[powerscript to switch to 800x600]
devmode dm
long a
dm.dmPelsWidth = 800
dm.dmPelsHeight = 600
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
[powerscript to switch to 1024x768]
devmode dm
long a
dm.dmPelsWidth = 1024
dm.dmPelsHeight = 768
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
Here you can download a devmode structure and a test window. Just import them in a PBL and run the window.
/////////////////
$PBExportHeader$w_res.srw
$PBExportComments$change resolution
forward
global type w_res from Window
end type
type cb_2 from commandbutton within w_res
end type
type cb_1 from commandbutton within w_res
end type
end forward
type devmode from structure
character dmdevicename[32]
integer dmspecversion
integer dmdriverversion
integer dmsize
integer dmdriverextra
long dmfields
integer dmorientation
integer dmpapersize
integer dmpaperlength
integer dmpaperwidth
integer dmscale
integer dmcopies
integer dmdefaultsource
integer dmprintquality
integer dmcolor
integer dmduplex
integer dmyresolution
integer dmttoption
integer dmcollate
character dmformname[32]
integer dmlogpixels
long dmbitsperpel
long dmpelswidth
long dmpelsheight
long dmdisplayflags
long dmdisplayfrequency
long dmicmmethod
long dmicmintent
long dmmediatype
long dmdithertype
long dmreserved1
long dmreserved2
end type
global type w_res from Window
int X=837
int Y=388
int Width=795
int Height=496
boolean TitleBar=true
string Title="Untitled"
boolean ControlMenu=true
boolean MinBox=true
boolean MaxBox=true
boolean Resizable=true
cb_2 cb_2
cb_1 cb_1
end type
global w_res w_res
type prototypes
FUNCTION long ChangeDisplaySettingsA (ref devmode lpst, ulong Flags) &
LIBRARY "USER32.DLL"
end prototypes
type variables
Ulong CDS_FORCE = 8*16*16*16*16*16*16*16
long DM_BITSPERPEL_H = 4*16*16*16*16
long DM_PELSWIDTH_H = 8*16*16*16*16
long DM_PELSHEIGHT_H = 16*16*16*16*16
long DM_DISPLAYFLAGS_H = 2*16*16*16*16*16
end variables
on w_res.create
this.cb_2=create cb_2
this.cb_1=create cb_1
this.Control[]={this.cb_2,&
this.cb_1}
end on
on w_res.destroy
destroy(this.cb_2)
destroy(this.cb_1)
end on
type cb_2 from commandbutton within w_res
int X=224
int Y=220
int Width=297
int Height=88
int TabOrder=2
string Text="1024x768"
int TextSize=-10
int Weight=400
string FaceName="Arial"
FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable!
end type
event clicked;devmode dm
long a
dm.dmPelsWidth = 1024
dm.dmPelsHeight = 768
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
end event
type cb_1 from commandbutton within w_res
int X=224
int Y=124
int Width=297
int Height=88
int TabOrder=1
string Text="800x600"
int TextSize=-10
int Weight=400
string FaceName="Arial"
FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable!
end type
event clicked;devmode dm
long a
dm.dmPelsWidth = 800
dm.dmPelsHeight = 600
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
end event
FUNCTION long ChangeDisplaySettingsA (ref devmode lpst, ulong Flags) &
LIBRARY "USER32.DLL"
[structure definition, devmode]
character dmdevicename[32]
integer dmspecversion
integer dmdriverversion
integer dmsize
integer dmdriverextra
long dmfields
integer dmorientation
integer dmpapersize
integer dmpaperlength
integer dmpaperwidth
integer dmscale
integer dmdefaultsource
integer dmprintquality
integer dmcolor
integer dmduplex
integer dmresolution
integer dmttoption
integer dmcollate
character dmformname[32]
integer dmlogpixels
long dmbitsperpel
long dmpelswidth
long dmpelsheight
long dmdisplayflags
long dmdisplayfrequency
long dmicmmethod
long dmicmintent
long dmmediatype
long dmdithertype
long dmreserved1
long dmreserved2
[Instance variable declaration]
Ulong CDS_FORCE = 8*16*16*16*16*16*16*16
long DM_BITSPERPEL_H = 4*16*16*16*16
long DM_PELSWIDTH_H = 8*16*16*16*16
long DM_PELSHEIGHT_H = 16*16*16*16*16
long DM_DISPLAYFLAGS_H = 2*16*16*16*16*16
[powerscript to switch to 800x600]
devmode dm
long a
dm.dmPelsWidth = 800
dm.dmPelsHeight = 600
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
[powerscript to switch to 1024x768]
devmode dm
long a
dm.dmPelsWidth = 1024
dm.dmPelsHeight = 768
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
Here you can download a devmode structure and a test window. Just import them in a PBL and run the window.
/////////////////
$PBExportHeader$w_res.srw
$PBExportComments$change resolution
forward
global type w_res from Window
end type
type cb_2 from commandbutton within w_res
end type
type cb_1 from commandbutton within w_res
end type
end forward
type devmode from structure
character dmdevicename[32]
integer dmspecversion
integer dmdriverversion
integer dmsize
integer dmdriverextra
long dmfields
integer dmorientation
integer dmpapersize
integer dmpaperlength
integer dmpaperwidth
integer dmscale
integer dmcopies
integer dmdefaultsource
integer dmprintquality
integer dmcolor
integer dmduplex
integer dmyresolution
integer dmttoption
integer dmcollate
character dmformname[32]
integer dmlogpixels
long dmbitsperpel
long dmpelswidth
long dmpelsheight
long dmdisplayflags
long dmdisplayfrequency
long dmicmmethod
long dmicmintent
long dmmediatype
long dmdithertype
long dmreserved1
long dmreserved2
end type
global type w_res from Window
int X=837
int Y=388
int Width=795
int Height=496
boolean TitleBar=true
string Title="Untitled"
boolean ControlMenu=true
boolean MinBox=true
boolean MaxBox=true
boolean Resizable=true
cb_2 cb_2
cb_1 cb_1
end type
global w_res w_res
type prototypes
FUNCTION long ChangeDisplaySettingsA (ref devmode lpst, ulong Flags) &
LIBRARY "USER32.DLL"
end prototypes
type variables
Ulong CDS_FORCE = 8*16*16*16*16*16*16*16
long DM_BITSPERPEL_H = 4*16*16*16*16
long DM_PELSWIDTH_H = 8*16*16*16*16
long DM_PELSHEIGHT_H = 16*16*16*16*16
long DM_DISPLAYFLAGS_H = 2*16*16*16*16*16
end variables
on w_res.create
this.cb_2=create cb_2
this.cb_1=create cb_1
this.Control[]={this.cb_2,&
this.cb_1}
end on
on w_res.destroy
destroy(this.cb_2)
destroy(this.cb_1)
end on
type cb_2 from commandbutton within w_res
int X=224
int Y=220
int Width=297
int Height=88
int TabOrder=2
string Text="1024x768"
int TextSize=-10
int Weight=400
string FaceName="Arial"
FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable!
end type
event clicked;devmode dm
long a
dm.dmPelsWidth = 1024
dm.dmPelsHeight = 768
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
end event
type cb_1 from commandbutton within w_res
int X=224
int Y=124
int Width=297
int Height=88
int TabOrder=1
string Text="800x600"
int TextSize=-10
int Weight=400
string FaceName="Arial"
FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable!
end type
event clicked;devmode dm
long a
dm.dmPelsWidth = 800
dm.dmPelsHeight = 600
dm.dmBitsPerPel = 16
dm.dmFields = DM_PELSWIDTH_H + DM_BITSPERPEL_H
dm.dmSize = 188
a = ChangeDisplaySettingsA(dm, CDS_FORCE)
end event