Code: Select all
Procedure WindowCallback(Window, Message, wParam, lParam)
Select Message
Case #WM_CLOSE
DestroyWindow_(Window)
Result = 0
Case #WM_DESTROY
PostQuitMessage_(0)
Result = 0
Default
Result = DefWindowProc_(Window, Message, wParam, lParam)
EndSelect
ProcedureReturn Result
EndProcedure
#Style = #WS_EX_TOPMOST|#PB_Window_BorderLess
#StyleEx = #WS_EX_TOOLWINDOW
;--------------
WindowClass.s = "Test"
wc.WNDCLASSEX
wc\cbSize = SizeOf(WNDCLASSEX)
wc\lpfnWndProc = @WindowCallback()
wc\hCursor = LoadCursor_(0, #IDC_CROSS)
wc\hbrBackground = CreateSolidBrush_($0)
wc\lpszClassName = @WindowClass
RegisterClassEx_(@wc)
;--------------
lWindowWidth = 400
lWindowHeight = 300
hWnd = CreateWindowEx_(#StyleEx, WindowClass, "", #Style, 0, 0, lWindowWidth, lWindowHeight, 0, 0, 0, 0)
UpdateWindow_(hWnd)
ShowWindow_(hWnd,#SW_SHOWNORMAL)
SetForegroundWindow_(hWnd)
While GetMessage_(msg.MSG, 0, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend

