Results 1 to 12 of 12

Thread: Need some help making this code

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Smile Need some help making this code

    Hi,

    First and foremost, I want to thank you all for helping so much the past few days. I understand the purpose of this board is, in general, more or less to ask questions about certain aspects of VB6 that you're having problems with, but not to hold your hand through your whole project without you doing any work!

    However, I'm pretty new at VB6 and probably in a tiny bit deep with this project, given my experience.

    Enough already! On to the project;
    This article talks about supressing the click-noise in your WebBrowser controls. The very bottom post is what I'm wanting to do here, which you will see how it is done by reading his post.

    http://forums.microsoft.com/MSDN/Sho...54909&SiteID=1

    I understand fully what he's saying, problem is that I'm just not oriented with VB6 enough to set out and do these kind of things, so I'd really appreciate anyone's help with getting the actual code for this written out, if you give me a rough code I can make refinements.

    Thanks again for everyone's help.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Need some help making this code

    do a search in the forum for reading and writing registry keys
    the key you need to read /write, is shown in the link in the post you specify
    there will be hundreds of example in this forum for reading and writing to registry
    working out a safe proceedure to reset the sound when your program finishes is a little tricky, especially if your app crashes and does not get to the part needed to do the resetting, but there are various ways to solve that
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    Lively Member astroanu2004's Avatar
    Join Date
    Jan 2008
    Location
    Sri Lanka
    Posts
    108

    Re: Need some help making this code

    if your using vb6 theres something called snippets. in there you'll find a function which you can use to read and write to the registry.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Re: Need some help making this code

    I've just about got everything figured out, but I was curious as to the legalities and rules of editing a user's registry keys that do not belong to the program itself. Aka, clearing them temporarily like in this situation. Particularly these keys, part of the operating system.

    I Google'd a bit but really didn't find anything.

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Need some help making this code

    it is bad practice to change users settings on there computers, you should in most cases work around their settings, in some case the user is just using a default setting because it is there and they don't know how to change, i hate programs that decide how i want my computer to behave, especially without asking /notifying
    also changing any registry key should be undertaken with care, as screwing up the registry can stop windows from working, and make your program really popular
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Need some help making this code

    While technically it's not really illegal to edit a user's settings.... it's a matter of ethics and trust. I won't use apps that seem to arbitrarily change settings, especially w/o notice, warning or my consent... Maybe I have that turned on for a reason....

    -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??? *

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2008
    Posts
    268

    Re: Need some help making this code

    I will likely offer it as an extra unchecked-by-default option in my installer, dubbing it a fix for what some users find repetitive or annoying in our software.

    Thanks for the info.

  8. #8
    Lively Member astroanu2004's Avatar
    Join Date
    Jan 2008
    Location
    Sri Lanka
    Posts
    108

    Re: Need some help making this code

    So why cant you use a code that will look up if that perticular option is true on registry make it false. and when the app exits execution, make the setting to the previous true state?

  9. #9
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Need some help making this code

    As westconn1 and TG explained above, it is a very rude thing to do, here are the two main reasons:

    1) The setting can affect other programs (in this case, Internet Explorer), so they will act differently (or even fail completely) while your program is running.

    2) If for some reason you don't set it back again (like if your program crashes, or the PC does, or there is a power cut), the user will be stuck with the setting(s) that you chose.

  10. #10
    Lively Member
    Join Date
    Aug 2008
    Location
    Between the keyboard and the chair.
    Posts
    122

    Re: Need some help making this code

    Has this been resolved? as far as crashing/etc and not resetting the reg entry, a small app could be set to run at boot, resetting the value.

  11. #11
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Need some help making this code

    yes that is correct, but in the mean time all / any other apps using the same settings will still work differently to what is expected, one of the most common requests is to change the date settings on the computer to suit a program, which may screwup any number of other programs,
    much better to fix your program within your programs design
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  12. #12
    Lively Member
    Join Date
    Aug 2008
    Location
    Between the keyboard and the chair.
    Posts
    122

    Re: Need some help making this code

    hmm, I know in C++ you can expand on classes, could not this person expand on the browser class, and null out this event?

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