|
-
Jan 24th, 2010, 07:46 AM
#1
Thread Starter
Lively Member
[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?
-
Jan 24th, 2010, 08:03 AM
#2
Re: HELP: I got 2 VB6 questions!
 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
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 24th, 2010, 08:12 AM
#3
Thread Starter
Lively Member
Re: HELP: I got 2 VB6 questions!
 Originally Posted by akhileshbc
i don't think this will help me... :| This minimize app to systray (bottom-right), i don't want that:|!
-
Jan 24th, 2010, 08:15 AM
#4
Re: HELP: I got 2 VB6 questions!
 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... 
 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...???
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 24th, 2010, 08:22 AM
#5
Thread Starter
Lively Member
Re: HELP: I got 2 VB6 questions!
 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!
 Originally Posted by akhileshbc
May be you are missing some files... Why don't you create a setup program...??? 
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!
-
Jan 24th, 2010, 08:29 AM
#6
Re: HELP: I got 2 VB6 questions!
 Originally Posted by NumB
i'm looking for the ordinary right-click instance on taskbar!
Means what..??? 
 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...)
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 24th, 2010, 08:47 AM
#7
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.
-
Jan 24th, 2010, 09:00 AM
#8
Thread Starter
Lively Member
Re: HELP: I got 2 VB6 questions!
 Originally Posted by akhileshbc
Means what..??? 
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... :|

EDIT: The second question is solved!
Last edited by NumB; Jan 24th, 2010 at 09:10 AM.
-
Jan 24th, 2010, 09:12 AM
#9
Re: HELP: I got 2 VB6 questions!
 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... :|

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...???
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 24th, 2010, 09:29 AM
#10
Thread Starter
Lively Member
Re: HELP: I got 2 VB6 questions!
when i right click the app taskbar button i want the above menu to popup...
-
Jan 24th, 2010, 09:32 AM
#11
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.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 24th, 2010, 09:38 AM
#12
Thread Starter
Lively Member
Re: HELP: I got 2 VB6 questions!
i don't use any borderstyle... but i want that menu to popup
-
Jan 24th, 2010, 10:20 AM
#13
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.... 
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.)
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jan 24th, 2010, 12:55 PM
#14
Re: HELP: I got 2 VB6 questions!
 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
-
Jan 24th, 2010, 01:11 PM
#15
Thread Starter
Lively Member
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.
-
Jan 24th, 2010, 01:20 PM
#16
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
Last edited by LaVolpe; Jan 24th, 2010 at 01:26 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|