Results 1 to 9 of 9

Thread: Allow editing code while running, or auto-pause

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Allow editing code while running, or auto-pause

    Is it possible to hack the VB6 IDE so that while I'm running my program I can alt+tab back to the IDE and just start editing code without having to PAUSE and RESUME, or at least to make it auto-pause when the IDE gets focus, and auto-resume when it loses focus?

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,936

    Re: Allow editing code while running, or auto-pause

    It's possible, but I wouldn't advise it. From my vision of doing this, it would take two things, neither of which I'd advise:

    1) In an IDE AddIn, a system-wide hook that monitored when program focus/activation changed. It'd have to monitor whether it was your running program, your running IDE, or some other program ... and tell you when those things changed.

    2) Also in this IDE AddIn, some mechanism to issue a "break". You could possibly do it through some API version of SendKeys, or maybe there's a way to do it through calls to some VB6 DLL.

    Again, personally, I wouldn't want either of these in an AddIn to the IDE.

    (p.s., I've sent a note to the moderators to move this to the standard Q&A section.)
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Allow editing code while running, or auto-pause

    IT would be tricky because the code that's running may not be your code... so ... what should pause? The thread (all execution) or your code? State would have to be preserved as well, and restored... it just feels like opening Pandora's Box to me.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,064

    Re: Allow editing code while running, or auto-pause

    Press the keys Control+Pause.
    If it is executing code of your program it should go to edit mode.

  5. #5
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,936

    Re: Allow editing code while running, or auto-pause

    Quote Originally Posted by Eduardo- View Post
    Press the keys Control+Pause.
    If it is executing code of your program it should go to edit mode.
    Hi Eduardo. I read the OP that he wants that to "automatically" happen when he alt-tabs to/from his program.

    I guess he also wants an F5 (run) when he alt-tabs away from the VB6 IDE (if the IDE is in pause mode).
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  6. #6
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,064

    Re: Allow editing code while running, or auto-pause

    Quote Originally Posted by Elroy View Post
    Hi Eduardo. I read the OP that he wants that to "automatically" happen when he alt-tabs to/from his program.

    I guess he also wants an F5 (run) when he alt-tabs away from the VB6 IDE (if the IDE is in pause mode).
    Yes Elroy, now I've read the OP again and you are right.
    I think your proposed add-in could do it.

  7. #7
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,749

    Re: Allow editing code while running, or auto-pause

    Press ctrl+break on the keyboard in the vb6 focus state to stop the running MSGBOX dialog box.
    I wonder if there is any way to send buttons in the background to achieve this function?

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Allow editing code while running, or auto-pause

    It sounds to me like he is asking for a way to edit the code while it is actually running and as a backup asked for a way to auto pause and unpause the execution.
    I can't even imagine the problems that would happen if you could actually make changes while the code is executing, just think what might happen if it tries to execute a line while you are still editing it. A very strange question imo. As for the auto pause and unpause that may be possible but really would it be worth the effort? Not to mention that some edits require the code to be stopped and restarted in order to work. Seems like a waste of time to me.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jul 2016
    Posts
    230

    Re: Allow editing code while running, or auto-pause

    > It sounds to me like he is asking for a way to edit the code while it is actually running

    Well no. Elory is correct. I would like to just have the IDE pause the running program automatically when the IDE catches focus so I don't have to pause manually. I know I know there could be unforeseen consequences, but a man can dream...

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