본문 바로가기
PowerBuilder

파워빌더 함수 - 3 (L ~ P)

by 엔터티 2021. 6. 14.
반응형

 

 

파워빌더 함수 - 1 (A~D)

Arc( ) 주어진 좌표를 이용하여 아크를 그린다. Global External Function: FUNCTION boolean Arc(ulong hwnd, long r1, long r2, long r3, long r4, long a1, long a2, long a3, long a4) LIBRARY "Gdi32.dll" Sc..

www.entity.co.kr

 

 

파워빌더 함수 - 2 (E ~ G)

파워빌더 함수 - 1 (A~D) Arc( ) 주어진 좌표를 이용하여 아크를 그린다. Global External Function: FUNCTION boolean Arc(ulong hwnd, long r1, long r2, long r3, long r4, long a1, long a2, long a3, long a4..

www.entity.co.kr

LoadLibraryA( )


이 함수는 dll (활성)메모리에 로드합니다. 32비트에서만 사용할 수 있습니다. 

Global External Function:
FUNCTION ulong LoadLibraryA(string modname) LIBRARY "Kernel32.dll"

Script:
ulong modhandle

modhandle = LoadLibraryA("c:\windows\mydll.dll")  // Pathing isn't necessary if dll is in dos search path.
If modhandle > 0 Then
   MessageBox("Return Code", "Load Successful -> handle = " + string(modhandle))
else
   MessageBox("Result","Unable to load module")
end if



 

MciSendStringA( )


이 함수는 AVI파일을 PLAY하며 사용법이 좀 복잡합니다. 파워빌더에는 비슷한 함수가 없습니다. 

 

Global External Function:
FUNCTION long MciSendStringA(string cmd, REF string rtn, long size, long wnd) LIBRARY "winmm.dll"

Script:
string s_errortext
string filename

filename = "c:\pwrs\pb5i32\ex\code\pbspin.avi"
MciSendStringa ("open "+Filename+"  type AVIVideo alias test wait",s_errortext, 0,0)
MciSendStringa ("Window test handle " + string(handle(w_main)) + " wait",s_errortext, 0, 0)
MciSendStringa ("Put test destination wait",s_errortext, 0, 0)
MciSendStringa ("Play test wait", s_errortext, 0, 0)
MciSendStringa ("Close test", s_errortext, 0, 0)

 

 

MessageBoxA( )


이 함수는 메시지 박스를 출력합니다. 파워빌더의 MessageBox()와 유사합니다. 

 

Global External Function:
FUNCTION long MessageBoxA(ulong hwnd, ref string text, ref string title, ulong style) LIBRARY "User32.dll"

Script:
long rtn
ulong handle1, style1
string text1
string title1

handle1 = handle(parent)
text1 = "This is an API Messagebox"
title1 = "API MessageBox"
style1 = 0
rtn = MessageBoxA(handle1,text1,title1,style1)

 

 

Mouse_Event( )


이 함수는 마우스 포인터를 이동시키거나 마우스 버튼의 클릭이벤트를 발생시키거나 기타 유저가 마우스를 이용하여 할 수 있는 일을 합니다. 아래의 예제는 마우스를 왼쪽으로 80픽셀, 위로 50픽셀이동시킵니다. structure mousepos는 마우스의 이동전의 좌표입니다. 

 

Global External Function:
SUBROUTINE Mouse_Event(ulong dwflag,ulong dx,ulong dy,ulong cbutton,ulong dwextra) LIBRARY "User32.dll"

Structure:  (Mousepos)
long xpos, long ypos

Script:
int l_loop, lx, ly, lflag
mousepos mouseloc

lx = mouseloc.xpos
ly = mouseloc.ypos
lflag = 1  //1 = do nothing, 7 = L-button clicked, 25 = R-button clicked
mouse_event(lflag,-80,-50,0,0)

 

 

 

MoveToEx( ) & LineTo( )


MoveToEx()
는 주어진 좌표로 커서를 이동시키며, LineTo()는 현재 좌표에서 주어진 좌표까지 라인을 그립니다. 

 

Global External Function:
FUNCTION boolean MoveToEx(ulong hwnd,long wx, long wy,ref prepos prepos2) LIBRARY "Gdi32.dll"
FUNCTION boolean LineTo(ulong hwnd,long wx, long wy) LIBRARY "Gdi32.dll"

Structure:  (Prepos)
long xpos, long ypos

Script:
ulong l_handle, l_device
prepos previouspos

l_handle = handle(w_main)
l_device = GetDC(l_handle)
MoveToEx(l_device,100,100,previouspos)
LineTo(l_device,200,200)

 

 

 

MoveWindow( )


이 함수는 주어진 값에 따라 윈도우의 위치 및 크기를 변경합니다. 

 

Global External Function:
FUNCTION boolean MoveWindow(ulong whand,int wx,int wy,int ww,int wh,boolean wflag) LIBRARY "user32.dll"

Script:
boolean rtn
ulong l_handle, l_device
l_handle = handle(w_main)
rtn = MoveWindow(l_handle,10,10,100,100,true)
MessageBox("Return Code",string(rtn))

 

 

 

Pie( )


이 함수는 주어진 좌표를 이용하여 파이챠트에 기반을 둔 반원을 그립니다. 

 

Global External Function:
FUNCTION boolean Pie(ulong hwnd,long x1,long y1,long x2,long y2,long x3,long y3,long x4,long y4) LIBRARY "Gdi32.dll"

Script:
Boolean rtn
ulong l_handle,l_device

long lv[8]
lv[ ] = {10,50,290,220,0,0,80,0}
l_handle = handle(w_main)
l_device  = GetDC(l_handle)
rtn = Pie(l_device,lv[1],lv[2],lv[3],lv[4],lv[5],lv[6],lv[7],lv[8])

 

 

 

Polygon( )


이 함수는 주어진 좌표를 이용하여 도형에 기반한 타원을 그립니다. 

 

Global External Function:
FUNCTION boolean Polygon(hdc, ref struct poly poly2, int cnt) LIBRARY "Gdi32.dll"

Structure:  (Poly)
long xpos[5], long ypos[5]  //The size of the array is proportional to the number of sides in the Polygon.

Script:
ulong l_handle, l_device
int pcnt
l_handle = handle(w_main)
l_device = GetDC(l_handle)
pcnt = 5
poly poly3
poly3.xpos[ ] = {50,100,150,200,250}
poly3.ypos[ ] = {50,100,150,200,250}
Polygon(l_device,poly3,pcnt)

 

 

 

PostMessageA( )


이 함수는 지정된 윈도우에 의해서 만들어진 thread와 관련된 메시지(minimize, close) message queue post하며 이것이 처리되기전까지는 return되지 않는다. 

 

Global External Function:
FUNCTION boolean PostMessageA(ulong hwndle,UINT wmsg,ulong wParam,ulong lParam) Library "User32.dll"

Script:
ulong l_handle
boolean rtn

l_handle = handle(w_main)
rtn = PostMessageA(l_handle,274,61472,0)   // 61472 = minimize, 61488 = maximize, 61728 = normal state

 

 

 

 

파워빌더 함수 - 4 (R ~ W)

파워빌더 함수 - 1 (A~D) Arc( ) 주어진 좌표를 이용하여 아크를 그린다. Global External Function: FUNCTION boolean Arc(ulong hwnd, long r1, long r2, long r3, long r4, long a1, long a2, long a3, long a4..

www.entity.co.kr

반응형

댓글