Thread: OpenTextFile

Results 1 to 9 of 9
  1. #1
    OneCa's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    1

    OpenTextFile

    Hey

    I would like to know how to open txt file after the game is closed ?
    I have tried to done it like this
    Code:
    if (dwReason == DLL_PROCESS_DETACH)
    {
    ShellExecute(NULL,"open","C:\test.txt",NULL,NULL,SW_SHOWNORMAL);
    Beep(1000,1000);
    }
    I can hear beep when the game is closed but the test file doesn't open

    anyhelp please ?

    thx

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,669
    My Mood
    Breezy
    From MSDN:
    Quote Originally Posted by MSDN
    Warning There are serious limits on what you can do in a DLL entry point.
    Perhaps calling ShellExecute is one of those things you can't do. Also, it could be that user32.dll (the DLL which ShellExecute is located in) gets unloaded before that code is run so nothing happens. Beep exists in kernel32.dll and is normally the first to be loaded in a process and the last to be unloaded.
    Last edited by master131; 09-28-2012 at 08:57 AM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. #3
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by master131 View Post
    From MSDN:


    Perhaps calling ShellExecute is one of those things you can't do. Also, it could be that user32.dll (the DLL which ShellExecute is located in) gets unloaded before that code is run so nothing happens. Beep exists in kernel32.dll and is normally the first to be loaded in a process and the last to be unloaded.
    I'd go with this aswell...

    --
    Test that shellexecute on a normal code and see if it works. From the looks of it, it should.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  4. #4
    OneCa's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by Brinuz View Post


    I'd go with this aswell...

    --
    Test that shellexecute on a normal code and see if it works. From the looks of it, it should.
    worked as integer main ()
    {bla bla bla}

    but still doesn't work after process is detach

    do you know any another way ?

  5. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,669
    My Mood
    Breezy
    What about system("link here");
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. #6
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    You can use CreateProcess and use the lpCommandLine argument to specify a particluar argument to execute notepad.exe with. The first argument given to notepad is the name of the document you wish notepad to open.

    i.e

    "notepad lol.txt"



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  7. #7
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    system("notepad C:\Test.txt"); should work...


    CoD Minion from 09/19/2012 to 01/10/2013

  8. #8
    OneCa's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Posts
    83
    Reputation
    10
    Thanks
    1
    @-InSaNe- you can close this now

  9. #9
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Marked solved
    Light travels faster than sound. That's why most people seem bright until you hear them speak.