Thread: newbie problem, help very apreciated

  1. #1
    Registered User
    Join Date
    Jul 2004

    newbie problem, help very apreciated

    im trying to write an "instal" to add to a little program i wrote,
    nothing big, just to learn the basics.. I already figured out
    the menu and how to add to registry but im stuck on 2 things,
    Im looking for the "command" to copy my file to a location, example: if i double
    click "myprogram.exe" that it copy itself to "c:\Program Files\
    My program.. The second problem is how can i make a reboot..
    i tried this code :
    void far (*rebooter)();
    rebooter = (void far *) 0xFFFF0000;
    but it dont work, i think its c.
    (please also tell wich headers and or .lib files i need to include
    i use Dev C++)

    Thanx for the help !

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Welcome to the forums!

    SHGetSpecialFolderPath - will give you the location of the Program Files directory.
    CopyFile - will copy a file.
    AdjustTokenPrivileges - will enable the privilige required to reboot the computer.
    ExitWindowsEx - will reboot the computer.

    Search the board/web/msdn for samples for all of these.

  3. #3
    Registered User
    Join Date
    Jul 2004
    thanx, that was what i needed..

  4. #4
    Super Moderator
    Join Date
    Sep 2001
    Before Quzah gets here and says the same thing: would people please read the Forum rules, use subject lines that don't suggest the oh-so-unlikely possibility that you might be posting because you need help, and use code tags! And welcome to the forums!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. validation problem in a loop (newbie question)
    By Aisthesis in forum C++ Programming
    Replies: 11
    Last Post: 05-10-2009, 10:47 PM
  2. Newbie problem with scanf function...
    By Mithal in forum C Programming
    Replies: 1
    Last Post: 11-13-2005, 10:28 PM
  3. Newbie ... looping problem
    By StupidIntel in forum C++ Programming
    Replies: 12
    Last Post: 05-13-2004, 06:45 PM
  4. Problem with code (newbie question)
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-31-2002, 01:39 AM
  5. newbie coding problem
    By rippascal in forum C++ Programming
    Replies: 10
    Last Post: 01-08-2002, 11:45 PM