includepath "$\inc\"
$ FileName "QuadRotate2.exe"
'include "RTL32.inc"
include "RTL64.inc"
$ title "Rotating Quad2"
include "OpenglSceneFrame.inc"
' Note that we must specify exactly these equates
' all in uppercase , otherwise it can results in compilation errors
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_FAN 0x0006
#define GL_QUAD_STRIP 0x0008
sub initialize(sys hWnd)
'=======================
end sub
'
sub scene(sys hWnd)
'==================
'
static single s1,s2,s3,s4,ang1
ActiveFrame
' increase this angle for faster rotation between 1 and 10
angi1=1
'
glLoadIdentity
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
' Greenish Beige background color
glClearColor .91,.94,.82,1
'
'
s1=.2 'x y
s2=-1 'z
s3=0.5 'color
s4=s3*.2 'color
'
glrotatef ang1, 0,0,1
'
' original square -- this work
' glbegin GL_QUADS
' glcolor4f 00, s3, s3, 1 : glvertex3f -s1, -s1, s2
' glcolor4f s3, s3, 00, 1 : glvertex3f s1, -s1, s2
' glcolor4f s4, 0, s3, 1 : glvertex3f s1, s1, s2
' glcolor4f s4, 0, s3, 1 : glvertex3f -s1, s1, s2
' glend
' semi triangle -- this work
' glBegin GL_TRIANGLE_FAN
' glcolor4f 00, s3, s3, 1 : glvertex3f -s1, -s1, s2 '1st triangle
' glcolor4f s3, s3, 00, 1 : glvertex3f s1, -s1, s2
' glcolor4f s4, 0, s3, 1 : glvertex3f -.3,-.1, s2
' glcolor4f s4, 0, s3, 1 : glvertex3f s1, s1 , -s2 '2nd
' glcolor4f 00, s3, s3, 1 : glvertex3f s1, -s1, s2 '3rd
' glcolor4f 00, s3, s3, 1 : glvertex3f s1, s1, -s2 '4th
' glEnd
' Triangle -- this work
' ensure that z = -1. thru' out
' glBegin GL_TRIANGLES
' glColor3f 1.0, 0.0, 0.0 : glVertex3f 0.0, .3,-1.
' glColor3f 0.0, 1.0, 0.0 : glVertex3f 0.2, -0.1,-1.
' glColor3f 0.0, 0.0, 1.0 : glVertex3f -0.2,-0.1,-1.
' glEnd
' Triangle -- this work
' this place triangle off center and if we increase the -ve z
' the object gets smaller and will spin at a distance of 0.8 from the center
' glTranslatef .80, 0.0, -2.0
' glBegin GL_TRIANGLES
' glColor3f 1.0, 0.0, 0.0 : glVertex3f 0.0, .30,-1.0
' glColor3f 0.0, 1.0, 0.0 : glVertex3f 0.26,-0.15,-1.0
' glColor3f 0.0, 0.0, 1.0 : glVertex3f-0.26,-0.15,-1.0
' glEnd
' this work
' Half red square rotated off center
' glTranslatef 2.40,0.0,-10.0
' glBegin(GL_QUADS)
' glColor3f 1.0, 0.0, 1.0
' glVertex3f -1.0,-1.0, 0.0
' glColor3f 1.0, 1.0, 1.0
' glVertex3f 1.0,-1.0, 0.0
' glVertex3f 1.0, 1.0, 0.0
' glColor3f 1.0, 1.0, 1.0
' glVertex3f -1.0, 1.0, 0.0
' glEnd
' rotating off center Cube -- this work
' glTranslatef -2.0, -2.0, -12.0
' glBegin GL_QUADS
' glColor3f 0.0, 1.0, 0.0
' glVertex3f 1.0, 1.0,-1.0
' glVertex3f -1.0, 1.0,-1.0
' glVertex3f -1.0, 1.0, 1.0
' glVertex3f 1.0, 1.0, 1.0
' glColor3f 1.0, 0.5, 0.0
' glVertex3f 1.0,-1.0, 1.0
' glVertex3f -1.0,-1.0, 1.0
' glVertex3f -1.0,-1.0,-1.0
' glVertex3f 1.0,-1.0,-1.0
' glColor3f 1.0, 0.0, 0.0
' glVertex3f 1.0, 1.0, 1.0
' glVertex3f -1.0, 1.0, 1.0
' glVertex3f -1.0,-1.0, 1.0
' glVertex3f 1.0,-1.0, 1.0
'glColor3f 1.0, 1.0, 0.0
' glVertex3f 1.0,-1.0,-1.0
' glVertex3f -1.0,-1.0,-1.0
' glVertex3f -1.0, 1.0,-1.0
' glVertex3f 1.0, 1.0,-1.0
'glColor3f 0.0, 0.0, 1.0
' glVertex3f -1.0, 1.0, 1.0
' glVertex3f -1.0, 1.0,-1.0
' glVertex3f -1.0,-1.0,-1.0
' glVertex3f -1.0,-1.0, 1.0
' glColor3f 1.0, 0.0, 1.0
' glVertex3f 1.0, 1.0,-1.0
' glVertex3f 1.0, 1.0, 1.0
' glVertex3f 1.0,-1.0, 1.0
' glVertex3f 1.0,-1.0,-1.0
' glEnd
' DrawDiamond -- this work very well
' glTranslatef 1.4,0.0,-5.0
' glbegin GL_TRIANGLE_FAN 'top part
' glcolor3ub 255, 0, 0 : glvertex3f 0, 1.414, 0
' glcolor3ub 0, 255, 0 : glvertex3f 1, 0, 1
' glcolor3ub 0, 0, 255 : glvertex3f 1, 0,-1
' glcolor3ub 0, 255, 0 : glvertex3f -1, 0,-1
' glcolor3ub 0, 0, 255 : glvertex3f -1, 0, 1
' glcolor3ub 0, 255, 0 : glvertex3f 1, 0, 1
' glend
' glbegin GL_TRIANGLE_FAN 'bottom part
' glcolor3ub 255, 0, 0 : glvertex3f 0,-1.414, 0
' glcolor3ub 0, 255, 0 : glvertex3f 1, 0, 1
' glcolor3ub 0, 0, 255 : glvertex3f -1, 0, 1
' glcolor3ub 0, 255, 0 : glvertex3f -1, 0,-1
' glcolor3ub 0, 0, 255 : glvertex3f 1, 0,-1
' glcolor3ub 0, 255, 0 : glvertex3f 1, 0, 1
' glend
'draws a 3D cube object -- drawcube works
glTranslatef 1.4,0.0,-5.0
glBegin GL_QUADS
glRotatef ang1, 1.0, 1.0, 1.0 ' Rotate the quad on the X axis
glcolor3ub 255,0,0
glVertex3f 0.5, 0.5, -0.5 ' Top right of the quad (Top)
glVertex3f -0.5, 0.5, -0.5 ' Top left of the quad (Top)
glVertex3f -0.5, 0.5, 0.5 ' Bottom left of the quad (Top)
glVertex3f 0.5, 0.5, 0.5 ' Bottom right of the quad (Top)
glcolor3ub 255,255,0
glVertex3f 0.5, -0.5, 0.5 ' Top right of the quad (Bottom)
glVertex3f -0.5, -0.5, 0.5 ' Top left of the quad (Bottom)
glVertex3f -0.5, -0.5, -0.5 ' Bottom left of the quad (Bottom)
glVertex3f 0.5, -0.5, -0.5 ' Bottom right of the quad (Bottom)
glcolor3ub 255,0,255
glVertex3f 0.5, 0.5, 0.5 ' Top right of the quad (Front)
glVertex3f -0.5, 0.5, 0.5 ' Top left of the quad (Front)
glVertex3f -0.5, -0.5, 0.5 ' Bottom left of the quad (Front)
glVertex3f 0.5, -0.5, 0.5 ' Bottom right of the quad (Front)
glcolor3ub 0,0,255
glVertex3f 0.5, -0.5, -0.5 ' Top right of the quad (Back)
glVertex3f -0.5, -0.5, -0.5 ' Top left of the quad (Back)
glVertex3f -0.5, 0.5, -0.5 ' Bottom left of the quad (Back)
glVertex3f 0.5, 0.5, -0.5 ' Bottom right of the quad (Back)
glcolor3ub 0,255,255
glVertex3f -0.5, 0.5, 0.5 ' Top right of the quad (Left)
glVertex3f -0.5, 0.5, -0.5 ' Top left of the quad (Left)
glVertex3f -0.5, -0.5, -0.5 ' Bottom left of the quad (Left)
glVertex3f -0.5, -0.5, 0.5 ' Bottom right of the quad (Left)
glcolor3ub 255,128,0
glVertex3f 0.5, 0.5, -0.5 ' Top right of the quad (Right)
glVertex3f 0.5, 0.5, 0.5 ' Top left of the quad (Right)
glVertex3f 0.5, -0.5, 0.5 ' Bottom left of the quad (Right)
glVertex3f 0.5, -0.5, -0.5 ' Bottom right of the quad (Right)
glEnd
sleep (2)
glLoadIdentity
glTranslatef 1.5, 0.0, -7.0 ' Move right 1.5 units and into the screen
glRotatef ang1, 1.0, 1.0, 1.0 ' Rotate the quad on the X axis
glBegin GL_QUADS
glColor3f 0.0, 1.0, 0.0 ' Set the color to green
glVertex3f 1.0, 1.0, -1.0 ' Top right of the quad (Top)
glVertex3f -1.0, 1.0, -1.0 ' Top left of the quad (Top)
glVertex3f -1.0, 1.0, 1.0 ' Bottom left of the quad (Top)
glVertex3f 1.0, 1.0, 1.0 ' Bottom right of the quad (Top)
glColor3f 1.0, 0.5, 0.0 ' Set the color to orange
glVertex3f 1.0, -1.0, 1.0 ' Top right of the quad (Bottom)
glVertex3f -1.0, -1.0, 1.0 ' Top left of the quad (Bottom)
glVertex3f -1.0, -1.0, -1.0 ' Bottom left of the quad (Bottom)
glVertex3f 1.0, -1.0, -1.0 ' Bottom right of the quad (Bottom)
glColor3f 1.0, 0.0, 0.0 ' Set the color to red
glVertex3f 1.0, 1.0, 1.0 ' Top right of the quad (Front)
glVertex3f -1.0, 1.0, 1.0 ' Top left of the quad (Front)
glVertex3f -1.0, -1.0, 1.0 ' Bottom left of the quad (Front)
glVertex3f 1.0, -1.0, 1.0 ' Bottom right of the quad (Front)
glColor3f 1.0, 1.0, 0.0 ' Set the color to yellow
glVertex3f 1.0, -1.0, -1.0 ' Top right of the quad (Back)
glVertex3f -1.0, -1.0, -1.0 ' Top left of the quad (Back)
glVertex3f -1.0, 1.0, -1.0 ' Bottom left of the quad (Back)
glVertex3f 1.0, 1.0, -1.0 ' Bottom right of the quad (Back)
glColor3f 0.0, 0.0, 1.0 ' Set the color to blue
glVertex3f -1.0, 1.0, 1.0 ' Top right of the quad (Left)
glVertex3f -1.0, 1.0, -1.0 ' Top left of the quad (Left)
glVertex3f -1.0, -1.0, -1.0 ' Bottom left of the quad (Left)
glVertex3f -1.0, -1.0, 1.0 ' Bottom right of the quad (Left)
glColor3f 1.0, 0.0, 1.0 ' Set the color to violet
glVertex3f 1.0, 1.0, -1.0 ' Top right of the quad (Right)
glVertex3f 1.0, 1.0, 1.0 ' Top left of the quad (Right)
glVertex3f 1.0, -1.0, 1.0 ' Bottom left of the quad (Right)
glVertex3f 1.0, -1.0, -1.0 ' Bottom right of the quad (Right)
glEnd
sleep (2)
' draw the pyramid using triangles
' // Reset the view
glLoadIdentity
glTranslatef -1.5, 0.0, -6.0 ' Move left 1.5 units and into the screen
glRotatef ang1, 0.0, 1.0, 0.0 ' Rotate the triangle on the Y axis
glBegin %GL_TRIANGLES
' Front
glColor3f 1.0, 0.0, 0.0 ' Red
glVertex3f 0.0, 1.0, 0.0 ' Top of triangle (Front)
glColor3f 0.0, 1.0, 0.0 ' Green
glVertex3f -1.0, -1.0, 1.0 ' Left of triangle (Front)
glColor3f 0.0, 0.0, 1.0 ' Blue
glVertex3f 1.0, -1.0, 1.0 ' Right of triangle (Front)
' Right
glColor3f 1.0, 0.0, 0.0 ' Red
glVertex3f 0.0, 1.0, 0.0 ' Top of triangle (Right)
glColor3f 0.0, 0.0, 1.0 ' Blue
glVertex3f 1.0, -1.0, 1.0 ' Left of triangle (Right)
glColor3f 0.0, 1.0, 0.0 ' Green
glVertex3f 1.0, -1.0, -1.0 ' Right of triangle (Right)
' Back
glColor3f 1.0, 0.0, 0.0 ' Red
glVertex3f 0.0, 1.0, 0.0 ' Top of triangle (Back)
glColor3f 0.0, 1.0, 0.0 ' Green
glVertex3f 1.0, -1.0, -1.0 ' Left of triangle (Back)
glColor3f 0.0, 0.0, 1.0 ' Blue
glVertex3f -1.0, -1.0, -1.0 ' Right of triangle (Back)
' Left
glColor3f 1.0, 0.0, 0.0 ' Red
glVertex3f 0.0, 1.0, 0.0 ' Top of triangle (Left)
glColor3f 0.0, 0.0, 1.0 ' Blue
glVertex3f -1.0, -1.0, -1.0 ' Left of triangle (Left)
glColor3f 0.0, 1.0, 0.0 ' Green
glVertex3f -1.0, -1.0, 1.0 ' Right of triangle (Left)
glEnd
'
'UPDATE ROTATION ANGLES
'----------------------
'
ang1+=angi1
if ang1>360 then ang1-=360
'
end sub
sub Release(sys hwnd)
'====================
end sub
' OpenglSceneFrameSpQ.inc
' This is custom made for the Quad Rotate2 with the frame size
'CONDITIONAL/DEFAULT EQUATES
' custom made for cubic sphere
%% title "OpenGl Scene"
%% width 300
%% height 300
%% keydown
'
#ifndef ExplicitMain
MainWindow width,height,%WS_POPUP
#endif
macro CreateMainWindow
======================
hwnd = CreateWindowEx(
0, 'extended styles
"wins", 'class name
"Main Window", 'window name
style, '
CW_USEDEFAULT, 'default horizontal position
CW_USEDEFAULT, 'default vertical position
width, 'defined width
height, 'defined height
null, 'no parent or owner window
null, 'class menu used
inst, 'instance handle
null); 'no window creation data
if not hWnd then
MessageBox 0,"Unable to create window","problem",MB_ICONERROR
exit function
end if
end macro
' custom made for Rotate Quad2
macro CreateMainWindowSpQ
======================
hwnd = CreateWindowEx(
0, 'extended styles
"wins", 'class name
"Main Window", 'window name
style, '
100, 'default horizontal position
100, 'default vertical position
width, 'defined width
height, 'defined height
null, 'no parent or owner window
null, 'class menu used
inst, 'instance handle
null); 'no window creation data
if not hWnd then
MessageBox 0,"Unable to create window","problem",MB_ICONERROR
exit function
end if
end macro
'
MainWindow width,height,WS_OVERLAPPEDWINDOW,2 'CENTRAL
Function MainWindow(int width,height,style,place=0)
=================================================
'
select place 'default, left, centre, right
case 0 : hpos=32 : vpos=32
case 1 : hpos=0: vpos=0
case 2 : hpos=(wawidth-width)>>1 : vpos=(WaHeight-height-32)>>1
case 3 : hpos=wawidth-width-6 : vpos=0
end select
'
...
Function MainWindow
===================
(
int width=640,
height=640,
style=WS_OVERLAPPEDWINDOW,
place=2
)
...
/*
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947(v=vs.85).aspx
BOOL WINAPI SystemParametersInfo(
_In_ UINT uiAction,
_In_ UINT uiParam,
_Inout_ PVOID pvParam,
_In_ UINT fWinIni
);
'uiAction
% SPI_GETWORKAREA 0x0030
'fWinIni
% SPIF_UPDATEINIFILE 0x01
% SPIF_SENDCHANGE 0x02
*/
int hpos,vpos,WaWidth,WaHeight
int spinfo[4]
scope
SystemParametersInfo 0x0030,0,@spinfo,0
indexbase 1
WaWidth=spinfo[3]
WaHeight=spinfo[4]
end scope
sub CenterWindow(sys hwnd, int place=0)
int width , height
' http://www.oxygenbasic.org/forum/index.php?topic=1636.msg17936;topicseen#msg17936
' Centerwindow.o2bas
$ filename "Centerwindow.exe"
uses rtl64
uses WinUtil
' for randomizer
! GetTickCount lib "kernel32.dll" alias "GetTickCount" () as dword
! srand cdecl lib "msvcrt.dll" (int seed)
! rand cdecl lib "msvcrt.dll" () as int
uses corewin
Use Chaos
seed=GetTickCount
#autodim off
% ID_BUTTON1=100
sys hButton1
'============================
' RGB function for O2
function RGB(int rcc, gcc, bcc) as int
return (rcc + gcc*256 + bcc*65536)
end Function
' ==============================
' RANDOMIZE TIMER; use once per the entire script
sub Randomize()
srand GetTickCount()
end sub
'==========================================
' draws with color gradient with random colors
SUB DrawGradientRnd (BYVAL hDC AS DWORD)
LOCAL rectFill AS RECT, rectClient AS RECT, fStep AS SINGLE
LOCAL hBrush AS DWORD, lOnBand AS LONG
GetClientRect WindowFromDC(hDC), rectClient
fStep = rectClient.bottom / 75
' local LastBand as Long
' LastBand = irnd( 189, 230 )
FOR lOnBand = 0 TO 199
SetRect rectFill, 0, lOnBand * fStep, rectClient.right + 1, (lOnBand + 1) * fStep
' paint the background -- change the first 2 colors R and G
' to vary the color gradient
hBrush = CreateSolidBrush(rgb(230- irnd( 9, 30 ), 240, 230 - lOnBand))
Fillrect hDC, rectFill, hBrush
DeleteObject hBrush
NEXT
END SUB
declare sub CenterWindow(sys hwnd, int place=0)
sys hInstance=inst
Randomize()
MainWindow 400,300,WS_OVERLAPPEDWINDOW
'============================================
function WndProc(sys hwnd, uMsg, wParam, lParam) as sys callback
int x
local hdc as sys
select uMsg
case WM_CREATE
hButton1 = CreateWindowEx (0,"button", "Start Demo",
WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP,
150, 200, 100, 30, hwnd, ID_BUTTON1,
hInstance, NULL)
case WM_COMMAND
if loword(wParam) = ID_BUTTON1 then
for x=0 to 4
CenterWindow(hwnd, x)
Sleep 1000 'wait a second
next
CenterWindow(hwnd)
end if
'graphic/drawing events
'sent when the window background must be erased such as resizing
CASE %WM_ERASEBKGND
hDC = wParam
' Pass the DC of the region to repaint
DrawGradientRnd hDC
FUNCTION = 1
EXIT FUNCTION
case WM_CLOSE
DestroyWindow(hwnd)
case WM_DESTROY
PostQuitMessage(0)
case else
return DefWindowProc(hwnd, uMsg, wParam, lParam)
end select
return 0
end function
==============================
sub CenterWindow(sys hwnd, int place=0)
'0=center, 1=left,2=top,3=right,4=bottom centered
int spinfo[4]
RECT rc
GetWindowRect(hwnd,&rc)
int hpos=rc.left,vpos=rc.top
int width=rc.right-rc.left
int height=rc.bottom-rc.top
SystemParametersInfo 0x0030,0,@spinfo,0 'SPI_GETWORKAREA=0x30
indexbase 1
int horz=spinfo[1]+(spinfo[3]-spinfo[1]-width)>>1
int vert=spinfo[2]+(spinfo[4]-spinfo[2]-height)>>1
select place
case 0 : hpos=horz : vpos=vert 'center
case 1 : hpos=spinfo[1] : vpos=vert 'left center
case 2 : hpos=horz : vpos=spinfo[2] 'top center
case 3 : hpos=spinfo[3]-width : vpos=vert 'right center
case 4 : hpos=horz : vpos=spinfo[4]-height 'bottom center
end select
SetWindowPos (hWnd, 0, hpos, vpos, width, height, 4) 'SWP_NOZORDER=4
end sub
case WM_COMMAND
if loword(wParam) = ID_BUTTON1 then
for x=0 to 4
CenterWindow(hwnd, x)
Sleep 1000 'wait a second
next
CenterWindow(hwnd)
end if
' http://www.oxygenbasic.org/forum/index.php?topic=1636.msg17936;topicseen#msg17936
' Centerwindow.o2bas
$ filename "Centerwindow.exe"
uses rtl64
uses WinUtil
' for randomizer
! GetTickCount lib "kernel32.dll" alias "GetTickCount" () as dword
! srand cdecl lib "msvcrt.dll" (int seed)
! rand cdecl lib "msvcrt.dll" () as int
uses corewin
Use Chaos
seed=GetTickCount
#autodim off
% ID_BUTTON1=100
sys hButton1
' for redrawing the window
%RDW_INVALIDATE 0x0001
%RDW_ERASE 0x0004
'============================
' RGB function for O2
function RGB(int rcc, gcc, bcc) as int
return (rcc + gcc*256 + bcc*65536)
end Function
' ==============================
' RANDOMIZE TIMER; use once per the entire script
sub Randomize()
srand GetTickCount()
end sub
'==========================================
' draws with color gradient with random colors
SUB DrawGradientRnd (BYVAL hDC AS DWORD)
LOCAL rectFill AS RECT, rectClient AS RECT, fStep AS SINGLE
LOCAL hBrush AS DWORD, lOnBand AS LONG
GetClientRect WindowFromDC(hDC), rectClient
fStep = rectClient.bottom / 75
' local LastBand as Long
' LastBand = irnd( 189, 230 )
FOR lOnBand = 0 TO 199
SetRect rectFill, 0, lOnBand * fStep, rectClient.right + 1, (lOnBand + 1) * fStep
' paint the background -- change the first 2 colors R and G
' to vary the color gradient
hBrush = CreateSolidBrush(rgb(230- irnd( 9, 30 ), 240, 230 - lOnBand))
Fillrect hDC, rectFill, hBrush
DeleteObject hBrush
NEXT
END SUB
declare sub CenterWindow(sys hwnd, int place=0)
sys hInstance=inst
Randomize()
MainWindow 400,300,WS_OVERLAPPEDWINDOW
'============================================
function WndProc(sys hwnd, uMsg, wParam, lParam) as sys callback
int x
local hdc as sys
select uMsg
case WM_CREATE
hButton1 = CreateWindowEx (0,"button", "Start Demo",
WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP,
150, 200, 100, 30, hwnd, ID_BUTTON1,
hInstance, NULL)
case WM_COMMAND
if loword(wParam) = ID_BUTTON1 then
for x=0 to 4
RedrawWindow(hwnd, NULL, NULL, RDW_ERASE or RDW_INVALIDATE)
CenterWindow(hwnd, x)
Sleep 1000 'wait a second
next
CenterWindow(hwnd)
end if
'graphic/drawing events
'sent when the window background must be erased such as resizing
CASE %WM_ERASEBKGND
hDC = wParam
' Pass the DC of the region to repaint
DrawGradientRnd hDC
FUNCTION = 1
EXIT FUNCTION
case WM_CLOSE
DestroyWindow(hwnd)
case WM_DESTROY
PostQuitMessage(0)
case else
return DefWindowProc(hwnd, uMsg, wParam, lParam)
end select
return 0
end function
==============================
sub CenterWindow(sys hwnd, int place=0)
'0=center, 1=left,2=top,3=right,4=bottom centered
int spinfo[4]
RECT rc
GetWindowRect(hwnd,&rc)
int hpos=rc.left,vpos=rc.top
int width=rc.right-rc.left
int height=rc.bottom-rc.top
SystemParametersInfo 0x0030,0,@spinfo,0 'SPI_GETWORKAREA=0x30
indexbase 1
int horz=spinfo[1]+(spinfo[3]-spinfo[1]-width)>>1
int vert=spinfo[2]+(spinfo[4]-spinfo[2]-height)>>1
select place
case 0 : hpos=horz : vpos=vert 'center
case 1 : hpos=spinfo[1] : vpos=vert 'left center
case 2 : hpos=horz : vpos=spinfo[2] 'top center
case 3 : hpos=spinfo[3]-width : vpos=vert 'right center
case 4 : hpos=horz : vpos=spinfo[4]-height 'bottom center
end select
SetWindowPos (hWnd, 0, hpos, vpos, width, height, 4) 'SWP_NOZORDER=4
end sub
I used Oxygen.dll of 29/03/2018 ...
... I compiled with gxo2.exe and co2.exe.
how to disable the button1 while the window is moving around within the loop for x = 0 t0 4 below
EnableWindow hButton1, %FALSE
... the difference arrises from these lines in the newer winutil.inc:
#ifndef width
int width=640
int height=480
#endif