CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Using Config Files

    Hello all,

    I am currently in the process of figuring out a way to make a media program automatically open a file and change settings using a config file. I have the source code of the media program, and I know that I am going to need to alter it to read from a config file. I was wondering if anyone could tell me, or at least explain to me how to effectively use them. I am thinking that to make this happen, I need to set some new variables in the source code of the program, and after reading the config file, to use these new variables to hold the values. Then I could somehow simulate user actions to load the file and change settings. I know this isn't all very clear, but I was wondering if someone could give me a little information on config files, and what carriage returns are.

  2. #2
    Join Date
    Apr 2009
    Posts
    598

    Re: Using Config Files

    I recommend AutoIt. See http://www.autoitscript.com/autoit3/

    Here is a script written for AutoIt:
    Code:
    Run("C:\foo_dir\foo.exe some_argument")
    
    WinWaitActive("foo")
    
    AutoItSetOption("SendKeyDelay", 50)
    Send("Hello, world!{ENTER}")
    Sleep(1000) 
    Send("How do you do?{ENTER}")

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Using Config Files

    Quote Originally Posted by olivthill2 View Post
    I recommend AutoIt. See http://www.autoitscript.com/autoit3/
    I would recommend a good C++ programming book. The task at hand is not very hard to do.

  4. #4
    Join Date
    Apr 2009
    Posts
    598

    Re: Using Config Files

    Which one?
    So far, I have not seen any good programming books about simulated keystrokes, mouse movement and manipulation of windows from other applications.

  5. #5
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Using Config Files

    Quote Originally Posted by olivthill2 View Post
    Which one?
    So far, I have not seen any good programming books about simulated keystrokes, mouse movement and manipulation of windows from other applications.
    This post is not about simulating keypresses or something. It's about changing some sourcecode and reading settings from a file and applying them. If you have the sourcecode of a program you don't need to 'simulate' keyclicks, you can simply call the function that actually does the work.

  6. #6
    Join Date
    Apr 2009
    Posts
    598

    Re: Using Config Files

    Yes, you are right. Excuse me.

    If you have the source code, you can read, parse a script file, and prepare a list of messages to be sent after WM_CREATE.

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

Featured