Restored from previous forum. Originally posted by PB.
Opens a window without a button for it in the Taskbar.
Various versions of this have already been posted, but some use ASM,
and some use very long API routines with CreateWindowEx, etc... this
is simple, compact and neat. Thanks to vanleth and Bericko for helping.
Code: Select all
; MENULESS VERSION -- Requires ResizeWindow as a result.
WinW=400 : WinH=200
If OpenWindow(0,200,200,WinW-1,WinH-1,"ToolWindow",#PB_Window_Invisible|#PB_Window_SystemMenu)
SetWindowLong_(WindowID(0),#GWL_EXSTYLE,#WS_EX_TOOLWINDOW)
ResizeWindow(0,#PB_Ignore,#PB_Ignore,WinW,WinH) : ShowWindow_(WindowID(0),#SW_SHOW)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
Code: Select all
; MENU VERSION -- Create your menu before showing the window!
If OpenWindow(0,200,200,400,200,"ToolWindow",#PB_Window_Invisible|#PB_Window_SystemMenu)
SetWindowLong_(WindowID(0),#GWL_EXSTYLE,#WS_EX_TOOLWINDOW)
; Define your menus here!
ShowWindow_(WindowID(0),#SW_SHOW)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf