It is currently Mon Sep 23, 2019 6:47 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Remove Title Bar completely or be able to color Title Bar
PostPosted: Wed Apr 03, 2019 3:49 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 17, 2007 8:35 pm
Posts: 112
Location: USA
Or both?

Look at this code:

Code:
Global MainWindow = OpenWindow(#PB_Any, 0, 0, 800, 800, "",   #WS_SIZEBOX | #PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowBounds(MainWindow, 800, 800, 10000, 10000)
SetWindowColor(MainWindow, RGB(1,200,200))

MainLoop:

Repeat
    Event = WindowEvent()
    If Event And EventWindow()=MainWindow
      Debug Event
    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf
    EndIf
  Until Quit = 1
 
 End


I need:

1) the titlebar gone COMPLETELY. A simple solution is best, if possible. Using #WS_SIZEBOX and #PB_Window_BorderLess as a combo almost does it, but on Windows 10, there is a small white bar still present, why? Is there another combo that removes it? I don't mind the black line at the border, just want it resizeable and no titlebar.

2) or if this 'has' to be this way, a way to color the white bar (titlebar) so that it's matching the rest of the window background.

3) the window needs to be resizable! So it's needing resizable ability, no titlebar, or the white bar gone completely.

It seems Windows should have some sort of combo already that does this. I mean, many people like apps with ability to resize, but maybe no title bar...

The platform is modern windows OS (windows 7 and up), but looking mostly for Windows 10 and beyond solution.

Any help is appreciated!

best,
Mike


Top
 Profile  
Reply with quote  
 Post subject: Re: Remove Title Bar completely or be able to color Title Ba
PostPosted: Wed Apr 03, 2019 5:35 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3402
Hi
Code:
Procedure WndProc(hwnd, uMsg, wParam, lParam)
  result = #PB_ProcessPureBasicEvents
  Select uMsg         
    Case #WM_NCCALCSIZE
      If OSVersion() >= #PB_OS_Windows_10
        *rc.RECT=lParam
        *rc\top - 5
      EndIf
     
    Case #WM_NCACTIVATE
      result = 1     
     
    Case #WM_EXITSIZEMOVE
      InvalidateRect_(hwnd,0,#True)
   
   EndSelect   
  ProcedureReturn result
EndProcedure

Global MainWindow = OpenWindow(#PB_Any, 0, 0, 800, 800, "",   #WS_SIZEBOX | #PB_Window_BorderLess |#PB_Window_ScreenCentered)
WindowBounds(MainWindow, 800, 800, 10000, 10000)
SetWindowColor(MainWindow, RGB(1,200,200))
SetWindowCallback(@WndProc())
MainLoop:

Repeat
    Event = WindowEvent()
    If Event And EventWindow()=MainWindow
      Debug Event
    If Event = #PB_Event_CloseWindow  ; If the user has pressed on the close button
      Quit = 1
    EndIf
    EndIf
  Until Quit = 1
 
 End

_________________
Egypt my love


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye