Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change window border style

Status
Not open for further replies.

dazzer123

IS-IT--Management
Nov 24, 2003
128
GB
I have a VB .Net application that, using Windows API, pulls Microsoft Mappoint in to it as a child window. What I now need to be able to do is change the border style of the Mappoint window so that it is no longer sizable.

Here is what I have so far
Code:
MpOpen = FindWindowNullClassName(0, "Map - Microsoft Mappoint Europe")


formHandle = Me.Handle.ToInt32

retval = SetWindowLong(MpOpen, GWL_STYLE, WS_CHILD Or WS_VISIBLE)

Dim bValue As Boolean
bValue = False

If bValue Then
    retval = retval Or WS_CAPTION
Else
    retval = retval And Not WS_CAPTION
End If

SetWindowLong(MpOpen, GWL_STYLE, retval)
SetWindowPos(MpOpen, HWND_Bottom, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOOWNERZORDER Or SWP_NOSIZE)
retval2 = SetParent(MpOpen, formHandle)

This may not be entirly accurate but you get the idea.

Any ideas on how I can now change mappoints border style would be really appriciated.
 
Done it!
Code:
        lStyle = GetWindowLong(MpOpen, GWL_STYLE)

        ' Set requested bit Off and Redraw.
        lstyle = lstyle And Not WS_THICKFRAME

        Call SetWindowLong(MpOpen, GWL_STYLE, lstyle)
        Const swpFlags As Integer = SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_NOSIZE
        SetWindowPos(MpOpen, 0, 0, 0, 0, 0, swpFlags)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top