Hi I must say that is very interesting problematic and like Charles say
i find something very interesting on Free Basic Forum.Look code:
#Include "windows.bi"
Dim As MSG msg ' Message variable (stores massages)
Dim As HWND hWnd ' Window variable
' Create window
hWnd = CreateWindowEx( 0, "#32770", "Hello", WS_OVERLAPPEDWINDOW Or WS_VISIBLE, 100, 100, 500, 300, 0, 0, 0, 0 )
While GetMessage( @msg, 0, 0, 0 ) ' Get message from window
TranslateMessage( @msg )
DispatchMessage( @msg )
Select Case msg.hwnd
Case hWnd ' If msg is window hwnd: get messages from window
Select Case msg.message
Case 273 ' Get message when 'X' was pressed
End
End Select
End Select
Wend
You must say that look very simple.
And little bit weird.So i try something similiar on CBasic and work
but not properly.I can open new window,without focus and can not
be closed with closebox button"X".One interesting thing ,window is
like standalone compiled app
I don't try on thinBasic bacose i don't know shape of APi-s.
Is the same like this or different?
DECLARE "user32",CreateWindowExA(dwExStyle AS INT,lpClassName AS STRING,lpWindowName AS STRING,dwStyle AS INT,x AS INT,y AS INT,nWidth AS INT,nHeight AS INT,hWndParent AS INT,hMenu AS INT,hInstance AS INT,lpParam AS INT),INT
DECLARE "user32",GetMessageA(lpMsg AS MSG,hwnd AS INT,wMsgFilterMin AS INT,wMsgFilterMax AS INT),INT
DECLARE "user32",TranslateMessage(lpMsg AS MSG),INT
DECLARE "user32",DispatchMessageA(lpMsg AS MSG),INT
DECLARE "user32", PostQuitMessage(nExitCode AS INT)
Bookmarks