fb:porticula NoPaste
Window_Ext_Window.bas
Uploader: | Eternal_Pain |
Datum/Zeit: | 07.03.2014 14:24:43 |
#Include once "Window_Ext.bas"
Declare Function NewWindow(byval t as string = "", _ 'Title
byval posx as integer, _ 'position
byval posy as integer, _ 'position
byval w as integer, _ 'width
byval h as integer, _ 'height
byval s as integer = WS_OVERLAPPEDWINDOW or WS_VISIBLE, _ 'style
byval p as integer = 0) as any ptr 'parent (hwnd)
Function NewWindow(byval t as string = "", byval posx as integer, byval posy as integer, byval w as integer, byval h as integer, byval s as integer = WS_OVERLAPPEDWINDOW or WS_VISIBLE, byval p as integer = 0) as any ptr
Dim as Node_Windows ptr NewWin = NEW Node_Windows
Dim as HWND handle
Dim as RECT boundb
boundb.left = posx
boundb.top = posy
boundb.right = posx+w
boundb.bottom = posy+h
AdjustWindowRectEx(@boundb, s, FALSE, NULL)
handle = CreateWindowEx(WS_EX_APPWINDOW,strptr(Globals.ClassName),t,s,boundb.left,boundb.top,boundb.right-boundb.left,boundb.bottom-boundb.top,cast(HWND,p),NULL,Globals.hInstance,@NewWin)
If (handle = 0) Then MessageBox(NULL,"Window failed!", "Error", NULL) : return 0
NewWin->WindowHandle = handle
Globals.WindowList.AddWindow(NewWin)
Return handle
End Function
'***********************************************'
NewWindow("test1",10,100,200,150)
NewWindow("test2",50,150,200,150)
NewWindow("test3",90,200,200,150)
NewWindow("test4",140,250,200,150)
Dim as MSG u_Msg
do
If (PeekMessage(@u_Msg,NULL,0,0,PM_REMOVE)) Then
TranslateMessage(@u_Msg)
DispatchMessage(@u_Msg)
End If
'?u_Msg.message
loop until multikey(&h01)