Showing system menu

  • Thread starter Thread starter Jordi Rico
  • Start date Start date
J

Jordi Rico

Hi,
we are making custom forms in our app, so we use forms with no border
and no control buttons in order to make all at our own.
The problem is that our customer wants the system menu functionality in
these forms, and since there is no border, the system menu don't show
when clicking on the top-left corner. I've added a button there, and
I'd like to know how to call this sytem menu from the click event in
this button.
Thanks.
 
Jordi,

Something as making a car with the brake at the right side and a throttle
left and than add a airbag for savety?

However maybe is a contextmenu something (right click menu)

Or create a small showdialogform with a menu which has as as owner the form.

Just some thoughts,

Cor
 
Jordi Rico said:
we are making custom forms in our app, so we use forms with no border
and no control buttons in order to make all at our own.
The problem is that our customer wants the system menu functionality in
these forms, and since there is no border, the system menu don't show
when clicking on the top-left corner. I've added a button there, and
I'd like to know how to call this sytem menu from the click event in
this button.

\\\
Private Declare Auto Function SendMessage Lib "user32.dll" ( _
ByVal hWnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32 _
) As Int32

Private Const WM_GETSYSMENU As Int32 = &H313

Public Class WordConverter
<StructLayout(LayoutKind.Explicit)> _
Private Structure DWord
<FieldOffset(0)> Public LongValue As Integer
<FieldOffset(0)> Public LoWord As Short
<FieldOffset(2)> Public HiWord As Short
End Structure

Private Shared m_DWord As DWord

Public Shared Function MakeLong( _
ByVal LoWord As Short, _
ByVal HiWord As Short _
) As Integer
m_DWord.LoWord = LoWord
m_DWord.HiWord = HiWord
Return m_DWord.LongValue
End Function

Public Shared Function MakeLong( _
ByVal LoWord As Integer, _
ByVal HiWord As Integer _
) As Integer
Return MakeLong(CShort(LoWord), CShort(HiWord))
End Function

Public Shared Function LoWord(ByVal LongValue As Integer) As Short
m_DWord.LongValue = LongValue
Return m_DWord.LoWord
End Function

Public Shared Function HiWord(ByVal LongValue As Integer) As Short
m_DWord.LongValue = LongValue
Return m_DWord.HiWord
End Function
End Class
..
..
..
SendMessage( _
Me.Handle, _
WM_GETSYSMENU, _
0, _
WordConverter.MakeLong(Cursor.Position.X, Cursor.Position.Y) _
)
///
 
Thanks,
I'll try and check your code, I haven't been abled to find this code
anywhere!
 
Herfried,

You really go for win32 while winfx is starting?

(Probably I miss something and than I get a nice answer here)

:-))

Cor
 
Cor,

Cor Ligthert said:
You really go for win32 while winfx is starting?

Mhm... WinFX is a thing of the future and doesn't help at the moment :-).
 
Back
Top