ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform without title or border... (https://www.excelbanter.com/excel-programming/435389-userform-without-title-border.html)

SpeeD

Userform without title or border...
 
Hi guys

I´ve seen the following code in the a forum and copied to my workbook.The
problemis that i need to have a userform without borders not only without the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub

Peter T

Userform without title or border...
 
That should remove the border, or are you talking about changing the raised
effect to flat.

Regards,
Peter T

"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my workbook.The
problemis that i need to have a userform without borders not only without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub




Rick Rothstein

Userform without title or border...
 
That code removed both the title bar and the borders for me. Are you saying
that when you ran the code, it left the borders all around the UserForm?

--
Rick (MVP - Excel)


"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my workbook.The
problemis that i need to have a userform without borders not only without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub



SpeeD

Userform without title or border...
 
Hi Peter.

The problem is that a white(gray) line appears around the Box. I thinks it´s
the border.

Im REALLY over my head with this code....

Thnsk
SpeeD


"Peter T" wrote:

That should remove the border, or are you talking about changing the raised
effect to flat.

Regards,
Peter T

"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my workbook.The
problemis that i need to have a userform without borders not only without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub



.


SpeeD

Userform without title or border...
 
Hi rick

Exacly! The border is All around the user form.

Speed




"Rick Rothstein" wrote:

That code removed both the title bar and the borders for me. Are you saying
that when you ran the code, it left the borders all around the UserForm?

--
Rick (MVP - Excel)


"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my workbook.The
problemis that i need to have a userform without borders not only without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub


.


Peter T

Userform without title or border...
 
I guess you are talking about the raised effect as I queried earlier


Option Explicit
' for testing drop a commandbutton on the form
' named CommandButton1, so you can close the form!

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long

Private Const GWL_STYLE As Long = -16
Private Const WS_CAPTION As Long = &HC00000

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_APPWINDOW As Long = &H40000

Private Sub UserForm_Initialize()

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long

If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", Me.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", Me.Caption) 'XL2000+
End If

lStyle = GetWindowLong(mhWndForm, GWL_STYLE)
lStyle = lStyle And Not &HC00000

SetWindowLong mhWndForm, GWL_STYLE, lStyle

SetWindowLong mhWndForm, GWL_EXSTYLE, WS_EX_APPWINDOW

DrawMenuBar mhWndForm

End Sub

Private Sub CommandButton1_Click()
Unload Me
End Sub

Regards,
Peter T


"SpeeD" wrote in message
...
Hi Peter.

The problem is that a white(gray) line appears around the Box. I thinks
it´s
the border.

Im REALLY over my head with this code....

Thnsk
SpeeD


"Peter T" wrote:

That should remove the border, or are you talking about changing the
raised
effect to flat.

Regards,
Peter T

"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my
workbook.The
problemis that i need to have a userform without borders not only
without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption)
'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub



.




SpeeD

Userform without title or border...
 
Hi to all

I have to make a correction. After a careful look it´s a raise effect.
How can i remove this?

SpeeD




"SpeeD" wrote:

Hi rick

Exacly! The border is All around the user form.

Speed




"Rick Rothstein" wrote:

That code removed both the title bar and the borders for me. Are you saying
that when you ran the code, it left the borders all around the UserForm?

--
Rick (MVP - Excel)


"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my workbook.The
problemis that i need to have a userform without borders not only without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption) 'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub


.


SpeeD

Userform without title or border...
 

Yes Peter it´s the raise efect after all.
How can i remove it??

SpeeD


"Peter T" wrote:

I guess you are talking about the raised effect as I queried earlier


Option Explicit
' for testing drop a commandbutton on the form
' named CommandButton1, so you can close the form!

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long

Private Const GWL_STYLE As Long = -16
Private Const WS_CAPTION As Long = &HC00000

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_APPWINDOW As Long = &H40000

Private Sub UserForm_Initialize()

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long

If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", Me.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", Me.Caption) 'XL2000+
End If

lStyle = GetWindowLong(mhWndForm, GWL_STYLE)
lStyle = lStyle And Not &HC00000

SetWindowLong mhWndForm, GWL_STYLE, lStyle

SetWindowLong mhWndForm, GWL_EXSTYLE, WS_EX_APPWINDOW

DrawMenuBar mhWndForm

End Sub

Private Sub CommandButton1_Click()
Unload Me
End Sub

Regards,
Peter T


"SpeeD" wrote in message
...
Hi Peter.

The problem is that a white(gray) line appears around the Box. I thinks
it´s
the border.

Im REALLY over my head with this code....

Thnsk
SpeeD


"Peter T" wrote:

That should remove the border, or are you talking about changing the
raised
effect to flat.

Regards,
Peter T

"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my
workbook.The
problemis that i need to have a userform without borders not only
without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption)
'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub


.



.


Peter T

Userform without title or border...
 
The slightly revised code I posted should remove it, I take it you didn't
try it.

Regards,
Peter T

"SpeeD" wrote in message
...

Yes Peter it´s the raise efect after all.
How can i remove it??

SpeeD


"Peter T" wrote:

I guess you are talking about the raised effect as I queried earlier


Option Explicit
' for testing drop a commandbutton on the form
' named CommandButton1, so you can close the form!

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long

Private Const GWL_STYLE As Long = -16
Private Const WS_CAPTION As Long = &HC00000

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_APPWINDOW As Long = &H40000

Private Sub UserForm_Initialize()

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long

If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", Me.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", Me.Caption) 'XL2000+
End If

lStyle = GetWindowLong(mhWndForm, GWL_STYLE)
lStyle = lStyle And Not &HC00000

SetWindowLong mhWndForm, GWL_STYLE, lStyle

SetWindowLong mhWndForm, GWL_EXSTYLE, WS_EX_APPWINDOW

DrawMenuBar mhWndForm

End Sub

Private Sub CommandButton1_Click()
Unload Me
End Sub

Regards,
Peter T


"SpeeD" wrote in message
...
Hi Peter.

The problem is that a white(gray) line appears around the Box. I thinks
it´s
the border.

Im REALLY over my head with this code....

Thnsk
SpeeD


"Peter T" wrote:

That should remove the border, or are you talking about changing the
raised
effect to flat.

Regards,
Peter T

"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my
workbook.The
problemis that i need to have a userform without borders not only
without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption)
'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption)
'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub


.



.




SpeeD

Userform without title or border...
 
Hi Peter!

It works great! sorry about this but i didn't realize that you.ve changed
the code earlier.

Thanks a lot!!

SpeeD

"Peter T" wrote:

The slightly revised code I posted should remove it, I take it you didn't
try it.

Regards,
Peter T

"SpeeD" wrote in message
...

Yes Peter it´s the raise efect after all.
How can i remove it??

SpeeD


"Peter T" wrote:

I guess you are talking about the raised effect as I queried earlier


Option Explicit
' for testing drop a commandbutton on the form
' named CommandButton1, so you can close the form!

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long

Private Const GWL_STYLE As Long = -16
Private Const WS_CAPTION As Long = &HC00000

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_APPWINDOW As Long = &H40000

Private Sub UserForm_Initialize()

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long

If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", Me.Caption) 'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", Me.Caption) 'XL2000+
End If

lStyle = GetWindowLong(mhWndForm, GWL_STYLE)
lStyle = lStyle And Not &HC00000

SetWindowLong mhWndForm, GWL_STYLE, lStyle

SetWindowLong mhWndForm, GWL_EXSTYLE, WS_EX_APPWINDOW

DrawMenuBar mhWndForm

End Sub

Private Sub CommandButton1_Click()
Unload Me
End Sub

Regards,
Peter T


"SpeeD" wrote in message
...
Hi Peter.

The problem is that a white(gray) line appears around the Box. I thinks
it´s
the border.

Im REALLY over my head with this code....

Thnsk
SpeeD


"Peter T" wrote:

That should remove the border, or are you talking about changing the
raised
effect to flat.

Regards,
Peter T

"SpeeD" wrote in message
...
Hi guys

I´ve seen the following code in the a forum and copied to my
workbook.The
problemis that i need to have a userform without borders not only
without
the
title bar.

Can anyone help me???

Option Explicit

Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long



Sub RemoveCaption(objForm As Object)

Dim lStyle As Long
Dim hMenu As Long
Dim mhWndForm As Long


If Val(Application.Version) < 9 Then
mhWndForm = FindWindow("ThunderXFrame", objForm.Caption)
'XL97
Else
mhWndForm = FindWindow("ThunderDFrame", objForm.Caption)
'XL2000+
End If
'lStyle = GetWindowLong(mhWndForm, -16)
lStyle = GetWindowLong(mhWndForm, -16)
lStyle = lStyle And Not &HC00000


SetWindowLong mhWndForm, -16, lStyle
DrawMenuBar mhWndForm

End Sub


.



.



.



All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com