I am so sorry my job takes most of my free time since I started this project. The old thread is dead, so I\'m posting what I have done in this new thread.
The concept was to create a skinable realtime window system for fullscreen exclusive mode.
Here is the unchanged source since Jan or Feb.
Rem Project: Ajtaji Winders
Rem Created: 1/11/2005 11:23:58 PM
load dll "kernel32.dll",1
Load dll "user32.dll",2
global aaa as dword
global bbb as dword
global time16 as double float=0.0
global cubetime as double float=0.0
global ddd as dword
global eee as dword
global ccc as dword
global ccc2 as dword
global time20 as double float=0.0
global FlipTime as double float=0.0
Global DBProTime
global Secondhalf as dword
global thirdhalf as double float=0.0
global flipvalue as double float=0.0
global remainder as double float=0.0
make memblock 1,16
for x=0 to 15
write memblock byte 1,x,0
next x
ccc=get memblock ptr(1)
ccc2=ccc+4
aaa=call dll (1, "QueryPerformanceFrequency",ccc)
bbb=*ccc
X= Call Dll (2,"GetSystemMetrics",0)
Y= Call Dll (2,"GetSystemMetrics",1)
`SetScreenSaverState=Call Dll (1,"SystemParametersInfoA",17,0,0,0): `Disable ScreenSaver
`SetScreenSaverState=Call Dll (1,"SystemParametersInfoA",17,1,0,0): `Enable ScreenSaver
Depth=Screen Depth()
Delete Dll 2
Set Display Mode X,Y,Depth
sync off
Rem ***** Main Source File *****
Load Image "BottomBorderCenter.png",1,1
Load Image "BottomBorderLeftCorner.png",2,1
Load Image "BottomBorderRightCorner.png",3,1
Load Image "CloseWindowGadgetUp.png",4,1
Load Image "LeftBorderDownFocus.png",5,1
Load Image "LeftUpperCornerFocus.png",6,1
Load Image "MaximizeGadgetUp.png",7,1
Load Image "MinimizeGadgetUp.png",8,1
Load Image "RightBorderDownFocus.png",9,1
Load Image "RightUpperCornerFocus.png",10,1
Load Image "TopCenterBorderFocus.png",11,1
Load Image "title.bmp",100,1
sync on:sync rate 0:backdrop on:color backdrop 0:fastsync
randomize timer()
#constant NUMOBJECTS 15
#constant DISTANCES 125.0
type POS
obj as DWORD
p as DWORD
endtype
type ANG
x# as float
y# as float
z# as float
endtype
global dim ang(360) as ANG
global dim pos(NUMOBJECTS) as POS
for zz=0 to 360
ang(zz).x#=0.0+(DISTANCES*cos(zz))
ang(zz).y#=0.0
ang(zz).z#=0.0+(DISTANCES*sin(zz))
next zz
for zz=1 to NUMOBJECTS
make object cube zz,30
texture object zz,100
pos(zz).obj=zz
pos(zz).p=(360/NUMOBJECTS)*zz
position object pos(zz).obj,ang(pos(zz).p).x#,ang(pos(zz).p).y#,ang(pos(zz).p).z#
next zz
`**************************************************
`Number of Windows you plan to use in your program*
Global NumberOfWindows as Integer=20
`**************************************************
Global Dim Font(1,255,3)
Global Dim WindowX(NumberOfWindows) as Integer
Global WindowX as Integer
Global Dim WindowY(NumberOfWindows) as Integer
Global WindowY as Integer
Global Dim WindowSizeX(NumberOfWindows) as word
Global WindowSizeX as word
Global Dim WindowSizeY(NumberOfWindows) as word
Global WindowSizeY as word
Global Dim GadgetInformation(NumberOfWindows,100,100) as word
Global Dim Focus(NumberOfWindows+10) as word
Global windows as Integer=0
Global Window as Integer=0
Global Debug as Byte=1
Global Error as Byte=0
Global Mclick as Byte=0
Global ClickFlag as Byte=0
Global MX as Integer=0
Global MY as Integer=0
Global MX2 as Integer=0
Global MY2 as Integer=0
Global MoveFlag as Byte=0
Global CurrentFocusFlag as Byte=0
Global Booger as Byte=0
Global GomerPile as Integer=0
Global Time as Integer=0
Global Time2 as Integer=0
Global RefreshFlag as Integer=0
Global SystemMenu as Integer=1
Global MsgText$ =""
Global StaticText$ =""
Global MsgText$ as Integer=0
Global StaticTextx as Integer=0
Global StaticTexty as Integer=0
Global MsgSize as Integer=0
Global Title$ =""
Global Dim NumberOfGadgets(NumberOfWindows)
Font(1,48,1)=1:Font(1,48,2)=1:Font(1,48,3)=1
Font(1,49,1)=1:Font(1,49,2)=2:Font(1,49,3)=2
Font(1,50,1)=1:Font(1,50,2)=1:Font(1,50,3)=1
Font(1,51,1)=1:Font(1,51,2)=1:Font(1,51,3)=1
Font(1,52,1)=1:Font(1,52,2)=1:Font(1,52,3)=1
Font(1,53,1)=1:Font(1,53,2)=1:Font(1,53,3)=1
Font(1,54,1)=1:Font(1,54,2)=1:Font(1,54,3)=1
Font(1,55,1)=1:Font(1,55,2)=1:Font(1,55,3)=1
Font(1,56,1)=1:Font(1,56,2)=1:Font(1,56,3)=1
Font(1,57,1)=1:Font(1,57,2)=1:Font(1,57,3)=1
Font(1,65,1)=0:Font(1,65,2)=1:Font(1,65,3)=1
Font(1,66,1)=0:Font(1,66,2)=1:Font(1,66,3)=1
Font(1,67,1)=0:Font(1,67,2)=1:Font(1,67,3)=1
Font(1,68,1)=0:Font(1,68,2)=1:Font(1,68,3)=1
Font(1,69,1)=0:Font(1,69,2)=1:Font(1,69,3)=1
Font(1,70,1)=0:Font(1,70,2)=1:Font(1,70,3)=1
Font(1,71,1)=0:Font(1,71,2)=1:Font(1,71,3)=1
Font(1,72,1)=0:Font(1,72,2)=1:Font(1,72,3)=1
Font(1,73,1)=0:Font(1,73,2)=1:Font(1,73,3)=1
Font(1,74,1)=0:Font(1,74,2)=1:Font(1,74,3)=0
Font(1,75,1)=0:Font(1,75,2)=1:Font(1,75,3)=1
Font(1,76,1)=0:Font(1,76,2)=1:Font(1,76,3)=1
Font(1,77,1)=0:Font(1,77,2)=1:Font(1,77,3)=1
Font(1,78,1)=0:Font(1,78,2)=1:Font(1,78,3)=1
Font(1,79,1)=0:Font(1,79,2)=1:Font(1,79,3)=1
Font(1,80,1)=0:Font(1,80,2)=1:Font(1,80,3)=1
Font(1,81,1)=0:Font(1,81,2)=1:Font(1,81,3)=1
Font(1,82,1)=0:Font(1,82,2)=1:Font(1,82,3)=1
Font(1,83,1)=0:Font(1,83,2)=1:Font(1,83,3)=1
Font(1,84,1)=0:Font(1,84,2)=1:Font(1,84,3)=0
Font(1,85,1)=0:Font(1,85,2)=1:Font(1,85,3)=1
Font(1,86,1)=0:Font(1,86,2)=1:Font(1,86,3)=1
Font(1,87,1)=0:Font(1,87,2)=0:Font(1,87,3)=0
Font(1,88,1)=0:Font(1,88,2)=0:Font(1,88,3)=0
Font(1,89,1)=0:Font(1,89,2)=-1:Font(1,89,3)=-1
`**********************************************************************************************
If Debug=0 then DISABLE ESCAPEKEY
`sync off
ink rgb (255,100,100),0
set text size 20
`windowx(window)=0:windowy(window)=0:windowsizex(window)=1023:windowsizey(window)=767
`for window=1 to windows
Title$="Window "+str$(window+1)
windowx=0:windowy=70:windowsizex=640:windowsizey=480
time2=timer()
createwindow()
`window=2
Title$="Window "+str$(window+1)
windowx=50:windowy=100:windowsizex=200:windowsizey=100
time2=timer()
createwindow()
`next window
MsgBox("Message Box Test, Ajtaji Advertising")
MsgBox("Powered by Ajtaji Winders")
MsgBox("Don't be a fool")
MsgBox("Buy more tools")
make object cube 201,30:position object 201,0,0,30
texture object 201,1000
gosub randomscroll
`CubeTime1()
starttime()
`FlipTime = ((ddd-eee)*1000.0)/bbb
wait 2000
`sync off
`**********************************************************************************************
flipvalue=16.3
MainLoop:
do
`
`ccc2=ccc+4
`secondhalf=*ccc2:thirdhalf=(secondhalf+1000000000000000000000)+aaa
`if aaa<eee then gosub Update cubes:goto mainloop
`if time16-cubetime<0 or time16-fliptime <0 then gosub updatecubes:flip()
`if aaa<eee then ddd=aaa:aaa=eee:eee=ddd:starttime():goto mainloop
if time16-CubeTime>=16.6 then Gosub UpdateCubes
`If time16-FlipTime>=16.6 then flip() :`If debug=1 then DebugInfo():
flip()
If Timer()-DBProtime>100 then gosub updatecubes:flip()
UpdateWindows()
aaa=call dll (1, "QueryPerformanceCounter",ccc)
aaa=*ccc
Time16 = (aaa*1000.0)/bbb
CONTROL CAMERA USING ARROWKEYS 0, .01, .01
loop
`**********************************************************************************************
Function CheckCollisions()
mclick=mouseclick()
If mclick=1 and clickflag=0 and booger<>0 then window=booger:refreshflag=booger:changefocus()
if mclick=0 then mx=mousex():my=mousey():moveflag=0:clickflag=0:CurrentFocusFlag=0:refreshflag=0:ExitFunction
mx2=mousex():my2=mousey()
if mclick=1 and moveflag=0 and clickflag=1 and mx2<windowx(window) or mx2>windowx(window)+windowsizex(window) or my2<windowy(window) or my2>windowy(window)+30 then clickflag=1
if mclick=1 and moveflag=0 and clickflag=0 and mx2>windowx(window) and mx2<windowx(window)+windowsizex(window) and my2>windowy(window) and my2<windowy(window)+30 then moveflag=1:clickflag=1
if moveflag=1 and clickflag=1 then windowx(refreshflag)=windowx(refreshflag)+(mx2-mx):windowy(refreshflag)=windowy(refreshflag)+(my2-my):mx=mousex():my=mousey():ChangeFocus():DrawWindows()
`if moveflag=1 and clickflag=1 and CurrentFocusFlag=0 and window<>focus(windows) then CurrentFocusFlag=1:gosub ChangeFocus
EndFunction
`**********************************************************************************************
Function ChangeFocus()
xx=0
error=0
currentFocus=refreshflag
if currentFocus=Focus(windows) then ExitFunction
for x=1 to (windows-1)
if focus(x)=refreshflag then xx=x
next x
if xx=0 then error=1:ExitFunction
for current=xx to (windows-1)
switch=Focus(current+1)
Focus(current)=switch
next current
Focus(windows)=refreshflag
for current=1 to windows
set sprite priority focus(current),current
`if current<>windows then set sprite alpha focus(current),220 else set sprite alpha focus(current),255
next current
EndFunction
`**********************************************************************************************
Function DrawWindows()
`for b=1 to windows
GomerPile=focus(windows)
sprite GomerPile,windowx(GomerPile),windowy(GomerPile),1000*GomerPile
`next b
EndFunction
`**********************************************************************************************
Function CreateWindow
`sync on
Windows=Windows+1
window=windows
windowx(window)=windowx:windowy(window)=windowy:windowsizex(window)=windowsizex:windowsizey(window)=windowsizey
focus(window)=window
cls rgb(236,233,216)
paste image 6,windowx(window),windowy(window)
paste image 10,windowx(window)+windowsizex(window)-50,windowy(window)
paste image 2,windowx(window),windowy(window)+windowsizey(window)-4
paste image 3,windowx(window)+windowsizex(window)-4,windowy(window)+windowsizey(window)-4
for x=0 to windowsizex(window)-99
paste image 11,x+windowx(window)+49,windowy(window)
next x
for x=0 to windowsizex(window)-8
paste image 1,x+windowx(window)+4,windowy(window)+windowsizey(window)-4
next x
for y=0 to windowsizey(window)-34
paste image 9,windowx(window)-4+windowsizex(window),windowy(window)+y+29
paste image 5,windowx(window),windowy(window)+y+29
next y
DrawStaticText()
if title$<>"" then ink rgb(255,255,255),0:staticTextx=windowx+5:StaticTexty=windowy+7:StaticText$=Title$:DrawStaticText()
DrawGadgets()
`Text windowx(window)+10,windowy(window)+40,str$(window)
`Text windowx(window)+10,windowy(window)+50,"Creation time="+str$(timer()-time2)
get image 1000*window,windowx(window),windowy(window),windowx(window)+windowsizex(window),windowy(window)+windowsizey(window),1
sprite window,windowx(window),windowy(window),1000*window
`sync off
Title$=""
EndFunction
`**********************************************************************************************
Function DrawGadgets()
If SystemMenu=1 then SystemMenuGadgets()
If NumberOfGadgets(window)=0 then ExitFunction
GadgetNumber=NumberOfGadgets(window)
For Gadgets=1 to GadgetNumber
Next Gadgets
EndFunction
Function SystemMenuGadgets()
paste image 4,windowx(window)+windowsizex(window)-28,windowy(window)+6
paste image 7,windowx(window)+windowsizex(window)-51,windowy(window)+6
paste image 8,windowx(window)+windowsizex(window)-74,windowy(window)+6
EndFunction
`**********************************************************************************************
Function CheckWindowCollision()
booger=0
mx=mousex():my=mousey()
CheckWindow=Windows
`**********************************************************************************************
Recheck:
WC=Focus(CheckWindow)
if mx> windowx(WC) and mx<windowsizex(WC)+windowx(WC) and my>windowy(WC) and my<windowsizey(WC)+windowy(wc) then Booger=wc:ExitFunction
checkwindow=checkwindow-1
if checkwindow<1 then ExitFunction
goto recheck
EndFunction
`**********************************************************************************************
Function DebugInfo()
`text 500,0,str$(ScreenSaverState):text 500,10,str$(SetScreenSaverState)
ink rgb (255,100,100),0
set cursor 0,25
print "Current Frames/Second="+str$(screen fps())
CurrentFocus=focus(windows)
`paste image 6,windowx(window)+20,windowy(window)+20
set cursor 0,10
print "Current Window Focus="+str$(CurrentFocus)
`c=focus(1):d=focus(2):e=focus(3):f=focus(4):g=focus(5)
`text 0,20,"Draw Order="+str$(c)+" "+str$(d)+" "+str$(e)+" "+str$(f)+" "+str$(g)
`text 0,20,str$(window)
set cursor 0,40
print "Window Collison="+str$(time16-fliptime)
EndFunction
`**********************************************************************************************
Function UpdateWindows()
for doober=1 to windows
window=doober
`**********************************************************************************************
doitagain:
CheckCollisions()
CheckWindowCollision()
`DrawWindows()
`
if moveflag=1 and clickflag=1 and RefreshFlag=0 then RefreshFlag=doober:CheckCollisions()`and currentFocusFlag=1
if moveflag=1 and clickflag=1 and RefreshFlag>0 then CheckCollisions()
next window
time=timer()
EndFunction
`**********************************************************************************************
Function PollGadgets()
EndFunction
`**********************************************************************************************
Function DrawText
EndFunction
`**********************************************************************************************
Function DrawStaticText
`Set Cursor StaticTextx,StaticTexty
Text StaticTextx,StaticTexty,StaticText$
EndFunction
`**********************************************************************************************
Function MsgBox(MsgText$)
Title$="MsgBox "+"Window "+str$(Windows+1)
MsgText=len(MsgText$)
StaticText$=MsgText$
MsgSize=MsgText*8
`cls rgb(0,0,0)
`Set Cursor 0,0
`Print MsgText$
`Get Image (1000*(windows+1))+1,0,0,MsgSize,15,1
windowsizey=100:windowsizex=100+MsgSize:windowx=(screen width()/2)-(windowsizex/2):windowy=(Screen height()/2)-(windowsizey/2):SystemMenu=0
StaticTextx=windowx+(windowsizex/2)-(MsgSize/2):StaticTexty=windowy+50
ink rgb (1,0,0),0
CreateWindow()
`Sprite (windows*1000)+1,windowx+(windowsizex/2)-(MsgSize/2),windowy+50,(windows*1000)+1
`set sprite priority (windows*1000)+1,10000
`get image 1000*windows+1,windowx,windowy,windowx+windowsizex,windowy+windowsizey,1
`delete sprite window:delete sprite (windows*1000)+1
`sprite window,windowx,windowy,windows*1000+1
EndFunction
`**********************************************************************************************
function rotate(directiond as DWORD)
local l as DWORD
local zz as DWORD
`for zz=1 to (360/NUMOBJECTS)
for l=1 to NUMOBJECTS
dec pos(l).p,2
if pos(l).p>360 then pos(l).p=0 else if pos(l).p<0 then pos(l).p=360
position object pos(l).obj,ang(pos(l).p).x#,ang(pos(l).p).y#,ang(pos(l).p).z#
next l
`sync
`next x
endfunction
`**********************************************************************************************
randomscroll:
d=rnd(2)
e=rnd(2)
if d>1 then b=1 else b=-1
if e>1 then c=1 else c=-1
return
`**********************************************************************************************
direction:
if i=360 or i>360 then direction=-1 else if i=1 or i<0 then direction=1
i=i+direction
return
`**********************************************************************************************
scroll:
rotate object 201,object angle x(201)+b,object angle y(201)+c,object angle z(201)+(b+c)
return
`**********************************************************************************************
UpdateCubes:
cubetime1()
`aaa=call dll (1, "QueryPerformanceCounter",ccc)
` aaa=*ccc
` CubeTime = (aaa*1000.0000000000)/bbb
`CubeTime=Timer()
Rotate(1)
gosub direction
rem Rotate Obj
gosub scroll
return
`**********************************************************************************************
`Set Display Mode ex (1)
function cubetime1()
`time20=time16-cubetime
`debuginfo()
timecall=call dll (1, "QueryPerformanceCounter",ccc)
ddd=*ccc
CubeTime = (ddd*1000.0)/bbb
`starttime()
endfunction
Function Flip()
timecall=call dll (1, "QueryPerformanceCounter",ccc)
ddd=*ccc
FlipTime = (ddd*1000.0)/bbb
debuginfo()
`starttime()
DBProtime=timer()
`unlock backbuffer
sync
`lock backbuffer
EndFunction
Function StartTime()
timecall=call dll (1, "QueryPerformanceCounter",ccc)
eee=*ccc
EndFunction
Lockup:
cls
looper:
print "time16=";time16;" cubetime=";cubetime;" Fliptime=";fliptime;" aaa=";aaa;" eee=";eee
sync
goto looper
Attached is the media to build the windows.