473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Showing system menu

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.

Nov 21 '05 #1
6 3254
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
Nov 21 '05 #2
"Jordi Rico" <jo*******@gmail.com> schrieb:
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) _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3
Thanks,
I'll try and check your code, I haven't been abled to find this code
anywhere!

Nov 21 '05 #4
Herfried,

You really go for win32 while winfx is starting?

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

:-))

Cor
Nov 21 '05 #5
Cor,

"Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
You really go for win32 while winfx is starting?


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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #6
The Custom Shaped Form on my site includes the Window Menu.
http://www.dotnetrix.co.uk/misc.html --> An example of a moveable/resizable
shaped form.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Jordi Rico" <jo*******@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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.

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Terrance | last post by:
Good Afternoon: I was hoping if someone could share some light on a problem that I'm facing. When I create a Visual Basic.Net program and I use the XP style for my Window Forms and buttons; if I...
0
by: Alireza Haghshenass | last post by:
Dear All, I am facing a problem which I could not solve. I am writing an application which uses a notify icon and a context menu bound to it to show modal dialog forms. When these forms is shown...
1
by: Henry | last post by:
I was trying to work through the Lab 2 exercises in the Microsoft's Windows-Based Applications in Visual C#. While I am not showing any errors I am also not seeing the mainMenu object when I run...
4
by: Baz | last post by:
Hi. I'm new to this VB.Net mullarkey, and I must say it is proving to be a very trying experience. Here is the latest in a long line of problems: The Scenario ========= I am building an...
1
by: tranky | last post by:
hi... ....i've a question for you! I use in web.config this: <location path="xxx/yyy"> <system.web> <authorization> <allow roles="x1,x2,x3,x4"/> <deny users="?"/> </authorization>
18
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I am using WindowsXP operating system. I was able to hide the files and to see them : I was going to the "Tool" menu then "Folder Option" and then "View" tab and "show the hidden files and...
2
by: Andreas Mueller | last post by:
Hi All, I'm trying to show a context menu during a drag drop operation similar to the windows explorers right click drag and drop behavior (A full working sample is at the end of the post): ...
1
by: Miro | last post by:
VB 2005 Express. I can create a simple MDI app, with 2 forms. On Form1 I add a menustrip on top - and click on ( Insert Standard Items ) Add a ToolStrip as well and add 2 buttons. On Form2,...
0
by: engloon | last post by:
Hi guys. I found this code that read a file then print out. The problem that I'm facing is, I have a lot of files to be printed, so I would like to print without showing the print property menu....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.