This is solved now. The problem was my cast of long
back as a long (bad in .NET integer better) to a intPtr.
would throw a wrench into the bitmask. Thank you
>-----Original Message-----
>On Sun, 6 Jul 2003 08:01:09 -0700, Joe Johnston wrote:
>
>> Thanks Kresimir, This is a superior declaration and I
>> have implimented the InteropServices.
>>
>> However, The call still yields the same results which
>> lead me to believe the I am calling the function wrong
or
>> there is some detail I am leaving out.
>
>
>this seems to work:
>
>
>Imports System.Runtime.InteropServices
>Imports System.ComponentModel
>Imports System.Windows.Forms
>Imports System.Environment
>
>Public Class Form1
> Inherits Form
>
> Private components As IContainer
> Private WS_OVERLAPPED As Integer = &H0
> Private WS_POPUP As Integer = &H80000000
> Private WS_CHILD As Integer = &H40000000
> Private WS_MINIMIZE As Integer = &H20000000
> Private WS_VISIBLE As Integer = &H10000000
> Private WS_DISABLED As Integer = &H8000000
> Private WS_CLIPSIBLINGS As Integer = &H4000000
> Private WS_CLIPCHILDREN As Integer = &H2000000
> Private WS_MAXIMIZE As Integer = &H1000000
> Private WS_CAPTION As Integer =
&HC00000 '/* WS_BORDER | WS_DLGFRAME */
> Private WS_BORDER As Integer = &H800000
> Private WS_DLGFRAME As Integer = &H400000
> Private WS_VSCROLL As Integer = &H200000
> Private WS_HSCROLL As Integer = &H100000
> Private WS_SYSMENU As Integer = &H80000
> Private WS_THICKFRAME As Integer = &H40000
> Private WS_GROUP As Integer = &H20000
> Private WS_TABSTOP As Integer = &H10000
> Private WS_MINIMIZEBOX As Integer = &H20000
> Private WS_MAXIMIZEBOX As Integer = &H10000
>
> Public Sub New()
> MyBase.New()
> InitializeComponent()
> End Sub
>
> Protected Overloads Overrides Sub Dispose(ByVal
disposing As Boolean)
> If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
>
> <DebuggerStepThrough()> Private Sub
InitializeComponent()
> components = New System.ComponentModel.Container
> Me.Text = "Form1"
> End Sub
>
> Private Sub Form1_Click(ByVal sender As Object,
ByVal e As System.EventArgs) Handles MyBase.Click
> Dim ret As Integer = User32DLL.GetWindowLong
(Me.Handle, -16)
> Dim s As String = String.Empty
> If (ret And WS_BORDER) Then s &= "WS_BORDER" &
NewLine
> If (ret And WS_CAPTION) Then s &= "WS_CAPTION" &
NewLine
> If (ret And WS_CHILD) Then s &= "WS_CHILD" &
NewLine
> If (ret And WS_CLIPCHILDREN) Then s
&= "WS_CLIPCHILDREN" & NewLine
> If (ret And WS_CLIPSIBLINGS) Then s
&= "WS_CLIPSIBLINGS" & NewLine
> If (ret And WS_DISABLED) Then s &= "WS_DISABLED"
& NewLine
> If (ret And WS_DLGFRAME) Then s &= "WS_DLGFRAME"
& NewLine
> If (ret And WS_GROUP) Then s &= "WS_GROUP" &
NewLine
> If (ret And WS_HSCROLL) Then s &= "WS_HSCROLL" &
NewLine
> If (ret And WS_MAXIMIZE) Then s &= "WS_MAXIMIZE"
& NewLine
> If (ret And WS_MAXIMIZEBOX) Then s
&= "WS_MAXIMIZEBOX" & NewLine
> If (ret And WS_MINIMIZE) Then s &= "WS_MINIMIZE"
& NewLine
> If (ret And WS_MINIMIZEBOX) Then s
&= "WS_MINIMIZEBOX" & NewLine
> If (ret And WS_OVERLAPPED) Then s
&= "WS_OVERLAPPED" & NewLine
> If (ret And WS_POPUP) Then s &= "WS_POPUP" &
NewLine
> If (ret And WS_SYSMENU) Then s &= "WS_SYSMENU" &
NewLine
> If (ret And WS_TABSTOP) Then s &= "WS_TABSTOP" &
NewLine
> If (ret And WS_THICKFRAME) Then s
&= "WS_THICKFRAME" & NewLine
> If (ret And WS_VISIBLE) Then s &= "WS_VISIBLE" &
NewLine
> If (ret And WS_VSCROLL) Then s &= "WS_VSCROLL" &
NewLine
> MessageBox.Show(s, "Styles")
> End Sub
>
>End Class
>
>Friend Class User32DLL
> <DllImport("User32.dll", EntryPoint:="GetWindowLong")
> _
> Friend Shared Function GetWindowLong(ByVal HWND As
IntPtr, ByVal Index As Integer) As Integer
> End Function
>End Class
>
>
>--Kresimir
>
http://www.inet.hr/~kkrecak
>.