1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
is it possible to intercept mouse clic and shortcut for this menu ?????
i showed you how to add another item into the menu.
i don't understand what do you mean by "intercept mouse clic "?
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
This will remove everything but Close from the system menu. If you uncomment the line for menu 6 it also disables the X. You could put an exit button on the form and exit that way.
VB Code:
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Const MF_REMOVE = &H1000&
Private Sub Form_Load()
Dim hSysMenu As Long, nCnt As Long
' Get handle to our form's system menu
' (Restore, Maximize, Move, close etc.)
hSysMenu = GetSystemMenu(Me.hwnd, False)
If hSysMenu Then
' Get System menu's menu count
nCnt = GetMenuItemCount(hSysMenu)
If nCnt Then
RemoveMenu hSysMenu, 7, MF_BYPOSITION Or MF_REMOVE
'RemoveMenu hSysMenu, 6, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, 5, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, 4, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, 3, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, 2, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, 1, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, 0, MF_BYPOSITION Or MF_REMOVE
I want if user click system menu, nothing append....
you wana to complitly remove the system defult mune for the app without removing the 3 command buttons? is it even posible?
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
If you subclass you can catch these messages like this :
VB Code:
Case WM_CONTEXTMENU
Exit Function
Case WM_SYSCOMMAND
If (wParam) = 61587 Then
Exit Function
End If
and the menu won't appear if you left or right click on the image in the top left. However, if you click on the taskbar on the app, you will get the system menu...
Full code :
VB Code:
'form code
Option Explicit
Private Sub Form_Load()
Hook Me.hWnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnHook
End Sub
VB Code:
'Module code
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
Not sure if anyboody mentioned yet so here we go: it's simple enough to create your own titlebar so if you're interested I have some sample code I can share.
Thanks. As I said I couldn't find my original project which took care of all that stuff so the one I uploaded was "1 hour quicky sample" but general idea is there.