Results 1 to 23 of 23

Thread: Close Debug Window using Keyboard (Addin Project)

  1. #1

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Arrow Close Debug Window using Keyboard (Addin Project)

    I know that Ctrl + G shows the debug window.
    Is is also possible to close it using the keyboard?


    Pradeep
    Last edited by Pradeep1210; Nov 26th, 2005 at 01:08 PM.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  2. #2
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Close Debug Window using Keyboard

    Control G shows the Immediate Window for me

  3. #3

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard

    Quote Originally Posted by paralinx
    Control G shows the Immediate Window for me
    Ha ha.. It shows for me too!

    I was looking for some way to close it using the keyboard.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  4. #4

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard

    With what I know it's not possible to do it. I was wondering if someone could help with some addin that could add this capability to VB6 editor.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  5. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Close Debug Window using Keyboard

    Forgive my ignorance, why it would be useful? You don't like the mouse? Or maybe the mouse doesn't work? Just curiosity.

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Close Debug Window using Keyboard

    Like any window use ALT-F4.

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Close Debug Window using Keyboard

    Quote Originally Posted by Pradeep1210
    With what I know it's not possible to do it. I was wondering if someone could help with some addin that could add this capability to VB6 editor.

    Pradeep
    If you are writing an add-in you could probably do this but I haven't tried it.

    VB Code:
    1. Public oVBE As VBIDE.VBE
    2.  
    3.  
    4. oVBE.Windows("Immediate").Close

  8. #8
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Close Debug Window using Keyboard

    Quote Originally Posted by brucevde
    Like any window use ALT-F4.
    that will close the entire program..

  9. #9
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Close Debug Window using Keyboard

    that will close the entire program..
    Not neccessarily. ALT-F4 closes the active window. If that is the VB IDE main window then yes VB will close.

    I should have said.

    CTRL-G
    ALT-F4

  10. #10
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Close Debug Window using Keyboard

    not for me man,

    I'll press control + G, then Alt + F4, and it will give me the "save project" message like your going to exit VB..

  11. #11

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard

    Quote Originally Posted by jcis
    Forgive my ignorance, why it would be useful? You don't like the mouse? Or maybe the mouse doesn't work? Just curiosity.
    Many a times we need to frequently check variable/property values or run some procedure or set some value while debugging thus using the debug window. Ctrl+G comes here handy.
    But as soon as that has been done and we want to resume debugging, we need more visible space and we need to close the debug window.

    When doing the above thing quite fast, it's a pain in the neck to touch the mouse every now and then.

    @brucevde
    Alt+F4 closes the entire application, Ctrl+F4 will close the active window in an MDI application.
    In VB IDE, it will close the debug window only when it is in window form, i.e. it is NOT docked. I want to close the debug window whether docked or not. (My debug window is usually docked)

    @Marty:
    When I start a new Addin Program, and run it, it doesn't seem to run. Do we need to do something else also for addin programs. I havn't made any addins yet.


    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  12. #12

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard

    OK got it working!

    But how do I trap keys?
    (say I want to press Ctrl+Shift+G) to close the debug window.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  13. #13
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Close Debug Window using Keyboard (Addin Project)

    Something like this
    VB Code:
    1. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    2.  
    3. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    4.     If GetAsyncKeyState(vbKeyG) And GetAsyncKeyState(vbKeyShift) And GetAsyncKeyState(vbKeyControl) Then
    5.         'Close Your Debug Window Here
    6.     End If
    7. End Sub
    8.  
    9. Private Sub Form_Load()
    10.     Me.KeyPreview = True
    11. End Sub

    Oops!, now I realize that you need it to work with the IDE, not an app, oh well.
    Last edited by jcis; Nov 26th, 2005 at 01:37 PM.

  14. #14

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard (Addin Project)

    Actually what I wanted to know is that how will the Shortcut apply to the IDE? How do I code it within the Addin?

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  15. #15

  16. #16
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Close Debug Window using Keyboard (Addin Project)

    Sorry Pradeep but I'm going to back out on my offer. While I've written a couple of addins (one of which is in the UtilityBank) it's still a lot of work and I guess I'm just not up to it. Let me suggest this book. It's the one I use.

  17. #17
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Close Debug Window using Keyboard (Addin Project)

    If you want to hook keys in general try this:

    http://www.vbaccelerator.com/home/VB...ol/article.asp

    You can use the code in the sample project to figure out how to do hooks (properly).

    I recently converted this code to a .DLL which means you could add it to your project as a Class Module (and a few modules) instead of as a user control. If you want to do that let me know and I will upload it. Otherwise just take your lead from that code and hook the "Ctrl+Shift+G" command and respond to it as you wish.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  18. #18

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard (Addin Project)

    OK After a bit of understanding, I made this addin.

    To use it, open the project, and compile the dll. Then close the IDE. After this whenever you open any project, you will find an entry in the "Add-ins" menu called "Hide Immideate Window"

    The only problem now is how to Assign Shortcut keys. Please help?

    Pradeep
    Attached Files Attached Files
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  19. #19
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Close Debug Window using Keyboard (Addin Project)

    Do you know how to remove this addin? its firing errors each time I open a project, and some menus desapeared or change position.

  20. #20

  21. #21
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Close Debug Window using Keyboard (Addin Project)

    Quote Originally Posted by Pradeep1210
    OK After a bit of understanding, I made this addin.

    To use it, open the project, and compile the dll. Then close the IDE. After this whenever you open any project, you will find an entry in the "Add-ins" menu called "Hide Immideate Window"

    The only problem now is how to Assign Shortcut keys. Please help?

    Pradeep
    Did you see post #17? That lets you do shortcuts. Its not that hard, but there is not VERY simple way of going about it.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  22. #22

    Thread Starter
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Close Debug Window using Keyboard (Addin Project)

    Quote Originally Posted by eyeRmonkey
    Did you see post #17? That lets you do shortcuts. Its not that hard, but there is not VERY simple way of going about it.
    *sigh* I understand how to use it in regular VB applications but I can't spot the way to use it for Addins.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  23. #23
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Close Debug Window using Keyboard (Addin Project)

    You can add a menu item to one of the IDE's menus and create a shortcut that way. This is how I added an "Initial Frame Placement" option in the Format menu.

    VB Code:
    1. Private Sub IDTExtensibility_OnConnection(ByVal VBInst As Object, ByVal ConnectMode As VBIDE.vbext_ConnectMode, ByVal AddInInst As VBIDE.AddIn, custom() As Variant)
    2.     On Error GoTo error_handler
    3.     'save the vb instance
    4.     Set VBInstance = VBInst
    5.    
    6.     'this is a good place to set a breakpoint and
    7.     'test various addin objects, properties and methods
    8.      
    9.     If ConnectMode = vbext_cm_External Then
    10.         'Used by the wizard toolbar to start this wizard
    11.         m_Place.VBIDE = VBInstance
    12.     Else
    13.         Set mcbMenuCommandBar = AddToAddInCommandBar("&Initial Frame Placement")
    14.         'sink the event
    15.         Set Me.MenuHandler = VBInst.Events.CommandBarEvents(mcbMenuCommandBar)
    16.     End If
    17.     Exit Sub
    18.    
    19. error_handler:
    20.    
    21.     MsgBox Err.Description
    22. End Sub
    23.  
    24. Function AddToAddInCommandBar(sCaption As String) As Office.CommandBarControl
    25.     Dim cbMenuCommandBar As Office.CommandBarControl  'command bar object
    26.     Dim cbMenu As Object
    27.  
    28.     On Error GoTo AddToAddInCommandBarErr
    29.    
    30.    
    31.     Set cbMenu = VBInstance.CommandBars("Format")
    32.     If cbMenu Is Nothing Then
    33.         'not available so we fail
    34.         Exit Function
    35.     End If
    36.    
    37.     'add it to the command bar
    38.     Set cbMenuCommandBar = cbMenu.Controls.Add(before:=3)
    39.     cbMenuCommandBar.BeginGroup = True
    40.     'set the caption
    41.     cbMenuCommandBar.Caption = sCaption
    42.    
    43.     Set AddToAddInCommandBar = cbMenuCommandBar
    44.    
    45.     Exit Function
    46.    
    47. AddToAddInCommandBarErr:
    48.  
    49. End Function

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