Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Jan 17, 2018 6:02 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Custom Window Frame
PostPosted: Thu May 24, 2012 5:32 am 
Offline
User avatar

Joined: Wed Oct 05, 2005 1:21 pm
Posts: 515
Location: United Kingdom
I'm looking for a way to create a custom window which lacks a title bar and a border. I've tried using the Frame = plain box property and, although this lacks a title bar, it still has the typical windows 7 glass border (unlike on the Mac where the frame is truly just a plain box).

Are there any declares I can use to get rid of the glass border effect on Windows 7?

Thanks

_________________
Gorgeous REALbasic controls from Figa Software | My Flickr | My Blog
11" MacBook Air 1.8Ghz i7, 4GB RAM, OSX 10.8.2, RB 2012 r1.1 Pro | iPhone 4S 32GB | Nikon D60


Top
 Profile  
Reply with quote  
 Post subject: Re: Custom Window Frame
PostPosted: Thu May 24, 2012 1:59 pm 
Offline

Joined: Sat Mar 12, 2011 9:18 am
Posts: 71
Private Sub ChangeWindowStyle(w As Window, flag As Integer, set As Boolean)
#if TargetWin32
Dim oldFlags as Integer
Dim newFlags as Integer
Dim styleFlags As Integer

Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOZORDER = &H4
Const SWP_FRAMECHANGED = &H20

Const GWL_STYLE = -16

Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (hwnd As Integer, _
nIndex As Integer) As Integer
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hwnd As Integer, _
nIndex As Integer, dwNewLong As Integer) As Integer
Declare Function SetWindowPos Lib "user32" (hwnd as Integer, hWndInstertAfter as Integer, _
x as Integer, y as Integer, cx as Integer, cy as Integer, flags as Integer) as Integer

oldFlags = GetWindowLong(w.Handle, GWL_STYLE)

if not set then
newFlags = BitwiseAnd( oldFlags, Bitwise.OnesComplement( flag ) )
else
newFlags = BitwiseOr( oldFlags, flag )
end


styleFlags = SetWindowLong( w.Handle, GWL_STYLE, newFlags )
styleFlags = SetWindowPos( w.Handle, 0, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER + SWP_FRAMECHANGED )
#endif
End Sub


In the Open event of the Window:
#if TargetWin32
Const WS_BORDER = &H800000
ChangeWindowStyle(self, WS_BORDER, false)

Const WS_CAPTION = &h00C00000
ChangeWindowStyle(self, WS_CAPTION, false)
#endif


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

All times are UTC - 5 hours


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group