Buchempfehlung
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
Windows-Programmierung. Das Entwicklerhandbuch zur WIN32-API
"Der" Petzold, das über 1000 Seiten starke Standardwerk zum Win32-API - besonders nützlich u. a. bei der GUI-Programmierung in FreeBASIC! [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Window_Ext_Window.bas

Uploader:MitgliedEternal_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)