0

Hi I need help with a project im working on im wondering if there is a way to include a file in a program. Im making a prank program that hides in the background and plays a funny wav file. Is there a way to include the wav file in the .exe so i dont have to put 2 files on his system? here is the source to my program

#include <windows.h>
#include <mmsystem.h>
#include <conio.h>
#include <winuser.h>
#include <iostream>

using namespace std;

int main()
{
    system("color 0c");
    system("ftype");
    
    PlaySound("C:\\crash.wav",NULL,SND_FILENAME|SND_ASYNC);
    
    SetConsoleTitle("csrsss.exe");
    HWND window = FindWindow(NULL,"csrsss.exe");
    ShowWindow(window,SW_HIDE);
    
    getch();
    return 0;
}
4
Contributors
9
Replies
10
Views
9 Years
Discussion Span
Last Post by Cyb3rAssasin
0

you don't have to do line 16 and 17. GetConsoleWindow() will return the HWND handle of the console program.

line 20: getch is not such a good idea in this program because there is no way for the program to terminate unless the user KNOWS that it is looking for keyboard input.

0

Okay thanks that reduced the file size :) which means that it wont look as suspicious in the processes tab in the taskman but how do I include crash.wav file with the .exe so i dont need to put 2 files on his computer?

0

Without getch(); it closes immediately and doesnt play the wave file. I need to keep the program open till the wave file stops playing.

0

K thanks. Any idea on how to include the wav file with the exe? If I put the wav file in the project can I call it by just doing PlaySound("crash.wav",NULL,SND_FILENAME|SND_ASYNC);?

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.