[RESOLVED] HELP: I got 2 VB6 questions!
1. What to do in order to see the menu on right click application on taskbar?
RESTORE; MOVE, SIZE, MINIMIZE, MAXIMIZE/ CLOSE!?
2. I don't know why but my application is opening fine on my xp sp2 x86, and on my friends pcs it doesn't. It closes automaticly at the window (form) which includes CommondDialog on it:|!
I sent them vbrun60sp3.exe and i told them to install this and still doesn't work. Why so?
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
NumB
1. What to do in order to see the menu on right click application on taskbar?
RESTORE; MOVE, SIZE, MINIMIZE, MAXIMIZE/ CLOSE!?
See this CodeBank submission on System Tray Programming.... http://www.vbforums.com/showthread.php?t=595990
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
akhileshbc
i don't think this will help me... :| This minimize app to systray (bottom-right), i don't want that:|!
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
NumB
i don't think this will help me... :| This minimize app to systray (bottom-right), i don't want that:|!
Can you tell us in detail about what you are looking for... :)
Quote:
Originally Posted by
NumB
2. I don't know why but my application is opening fine on my xp sp2 x86, and on my friends pcs it doesn't. It closes automaticly at the window (form) which includes CommondDialog on it:|!
I sent them vbrun60sp3.exe and i told them to install this and still doesn't work. Why so?
May be you are missing some files... Why don't you create a setup program...??? :wave:
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
akhileshbc
Can you tell us in detail about what you are looking for... :)
i'm looking for the ordinary right-click instance on taskbar!
Quote:
Originally Posted by
akhileshbc
May be you are missing some files... Why don't you create a setup program...??? :wave:
i know this is the reason, but i don't know which file is related to commondialog... i guess is comdlg32.ocx but i'm not sure, and i don't know which install i should download! I thought vbrun60sp3 will fix this problem since CommonDialog is a SP3 component!
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
NumB
i'm looking for the ordinary right-click instance on taskbar!
Means what..??? :confused:
Quote:
Originally Posted by
NumB
i know this is the reason, but i don't know which file is related to commondialog... i guess is comdlg32.ocx but i'm not sure, and i don't know which install i should download! I thought vbrun60sp3 will fix this problem since CommonDialog is a SP3 component!
Use VB's Package and Deployment wizard to create a setup. The folder to which we had created the new setup, will contain all the OCX and DLL files necessary for our program...
You can create a new setup program, including those files, using your favorite installer (eg. InnoSetup, Installshield, etc...) :wave:
Re: HELP: I got 2 VB6 questions!
You have to create a formal installation and setup file. You can't just copy things from one PC to another.
Once this is done, you will simply send your friend the Setup.Exe - NOT your actually program.
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
akhileshbc
Means what..??? :confused:
What's so hard to understand??? The normal right-click on the taskbar app button which shows you the Menu with maximize, minimize, close and so on option...
Like every window has... :|
http://img228.imageshack.us/img228/1658/64743537.png
EDIT: The second question is solved!
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
NumB
What's so hard to understand??? The normal right-click on the taskbar app button which shows you the Menu with maximize, minimize, close and so on option...
Like every window has... :|
http://www.vbforums.com/
Ok...
So, you want your application to automate rightclick, just like that, to other running applications.....???
Or,
You want to popup a menu like, that when the user clicks on somewhere in your form...???
Or,
You want to add more menu options to it. ie. When a user right clicks on application, it should display the menu like in the picture PLUS your own menus...????
Which one...??? :confused:
Re: HELP: I got 2 VB6 questions!
when i right click the app taskbar button i want the above menu to popup...
Re: HELP: I got 2 VB6 questions!
The display of those menus depends on the BorderStyle of your form... (That's what I think)
If you use FixedSingle, then only Move and Close menu will be displayed.
If you use Sizable, you will be able to see all the menus.
Re: HELP: I got 2 VB6 questions!
i don't use any borderstyle... but i want that menu to popup
Re: HELP: I got 2 VB6 questions!
I don't know what you really want... May be it's my fault in understanding the question.... :o
If you want to popup a menu on right clicking your form, then use the below code:
Code:
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then '~~~> Check if it is right click
PopupMenu mnuFile '~~~> Popup a menu
End If
End Sub
where, mnuFile is a top level menu created using Menu Editor and it contains some submenus.(eg. Open, Save, Exit,...etc.)
Re: HELP: I got 2 VB6 questions!
Quote:
Originally Posted by
NumB
i don't use any borderstyle... but i want that menu to popup
Sorry, that's one of the drawbacks of using a borderless form. To get that menu with a borderless form will require some significant workarounds; the most significant is subclassing your form. What you are asking requires a high level of expertise. You may want to search the net quite a bit more to see if an example may already be out there for you to use. Suggest searching with these key terms: Borderless System Menu
Re: HELP: I got 2 VB6 questions!
Thanks LaVolpe; this is what helped me:P:
Code:
'Show the icon of a titleless form in taskbar tray
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) _
As Long
Private Const GWL_STYLE = (-16)
Private Const WS_SYSMENU = &H80000
'<<<<<< Form load >>>>>>
Private Sub Form_Load()
Call SetWindowLong(Me.hwnd, GWL_STYLE, WS_SYSMENU)
End Sub
Thread Resolved.
Re: [RESOLVED] HELP: I got 2 VB6 questions!
Not quite. You should append the WS_SYSMENU to your style not set the style to just WS_SYSMENU.
Here is a better example, however, quick testing shows that the Close menu item does not work and may require subclassing to look for the WM_SYSCommand message or possibly a simpler workaround.
Code:
Option Explicit
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const WS_SYSMENU As Long = &H80000
Private Const WS_MINIMIZEBOX As Long = &H20000
Private Const WS_MAXIMIZEBOX As Long = &H10000
Private Const GWL_STYLE As Long = -16
Private Sub Form_Load()
SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, GWL_STYLE) Or WS_SYSMENU Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
' Exclude the minimizebox/maximizebox styles if you don't want those to be enabled in the menu
End Sub