Results 1 to 16 of 16

Thread: [RESOLVED] HELP: I got 2 VB6 questions!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    Resolved [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?

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by NumB View Post
    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,...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by akhileshbc View Post
    See this CodeBank submission on System Tray Programming.... http://www.vbforums.com/showthread.php?t=595990
    i don't think this will help me... :| This minimize app to systray (bottom-right), i don't want that:|!

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by NumB View Post
    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 View Post
    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,...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by akhileshbc View Post
    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 View Post
    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!

  6. #6
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by NumB View Post
    i'm looking for the ordinary right-click instance on taskbar!
    Means what..???

    Quote Originally Posted by NumB View Post
    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,...

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by akhileshbc View Post
    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.

  9. #9
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by NumB View Post
    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,...

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    Re: HELP: I got 2 VB6 questions!

    when i right click the app taskbar button i want the above menu to popup...

  11. #11
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    Re: HELP: I got 2 VB6 questions!

    i don't use any borderstyle... but i want that menu to popup

  13. #13
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  14. #14
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: HELP: I got 2 VB6 questions!

    Quote Originally Posted by NumB View Post
    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    85

    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.

  16. #16
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width