Thread: how do .. in c++

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    3

    how do .. in c++

    - how to get the current computer name (or username)

    - how to compress executable file but it still can run

    - how to make zip file

    - how to combine 2 exe files together (inject) that makes them run together

    - how to make our program run once in 5 day

    - how to modify registry using C++

    - how to check if one program (process) is currently running

    - how to search files

    thank you very much

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    - how to get the current computer name (or username)
    --- That's OS specific. Check the msdn documentation if you're on Windows.

    - how to compress executable file but it still can run
    --- As far as I know you can't compress a file and run it without decompressing it first.

    - how to make zip file
    --- Use WinZIP. Zip files are just a type of compression with specific keys for each piece of compressed data that remains uniform so it can be decompressed.

    - how to combine 2 exe files together (inject) that makes them run together
    --- You can have one executable call the other. Again this is OS specific, but you can get some ideas from the FAQ.

    - how to make our program run once in 5 day
    --- Well, you'd have to have some program active all the time that knows when the five days are up. Assuming you don't want to use your OS's standard scheduling processes, you have to write a program that stays open in a constant loop, and activates a conditional statement when the current time is 5 days greater than the last time it returned true.

    - how to modify registry using C++
    --- Not too sure about that one. Consult the windows documentation on how to edit the registry from a BAT file or the command prompt. From there, the Windows libraries provide many functions to pass strings to the shell.

    - how to check if one program (process) is currently running
    --- Not sure about that. Again, I'm sure windows offers some function to check that.

    - how to search files
    --- Try checking here.
    Last edited by SlyMaelstrom; 06-09-2006 at 08:18 AM.
    Sent from my iPadŽ

  3. #3
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    You and your dancing milkbox are awfully helpful today, Sly.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    I BSed half of those answers!
    ... and my milk box didn't try too hard to stop me.

    Anyway, to the OP, if you're really interested in finding out how to ZIP a file, check google on how to write your own data compression program. There are many levels to it that I've never looked into. The basic compression is basically replacing repeating strings with keyed characters. For instance, every instance of the in a sentence can be replaced with (char)192, or what have you. There is much more to professional data compression though. For instance, HowStuffWorks gives a good example of the LZ adaptive dictionary-based algorithm.
    Last edited by SlyMaelstrom; 06-09-2006 at 08:41 AM.
    Sent from my iPadŽ

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by SlyMaelstrom
    - how to compress executable file but it still can run
    --- As far as I know you can't compress a file and run it without decompressing it first.
    Ahem, yes you can...
    http://upx.sourceforge.net/

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    That link proves nothing.

    You must decompress in memory in order to run the code or the code is running through some type of interpreter which is going to slow it down.

  7. #7
    Sanity is for the weak! beene's Avatar
    Join Date
    Jul 2006
    Posts
    321
    if u wnt to make a zip file, rite clik on the file/folder/program and clik on send to, and then zipped folder

  8. #8
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Please don't reply to old threads. And please use correct spelling.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed