Advertisement
pinkdreams

Commend for Commend script

Feb 8th, 2023
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. /* Windows */
  2. #include <Windows.h>
  3. #include <TlHelp32.h>
  4.  
  5.  
  6. /* STL */
  7. #include <string>
  8.  
  9.  
  10. /* Sending commands to the console */
  11. void SendCopyData(HWND hWnd, std::string szCommand) {
  12.     COPYDATASTRUCT m_cData;
  13.     m_cData.cbData = szCommand.size() + 1;
  14.     m_cData.dwData = 0;
  15.     m_cData.lpData = (void*)szCommand.c_str();
  16.     SendMessageA(hWnd, WM_COPYDATA, 0, (LPARAM)&m_cData);
  17. }
  18.  
  19. /* Getting the window handle for convenience */
  20. HWND GetWindowHandle() {
  21.     return FindWindowA(0, "Counter-Strike: Global Offensive - Direct3D 9");
  22. }
  23.  
  24. void main() {
  25.  
  26.     SetConsoleTitleA("Commend for Commend");
  27.    
  28.     while (true) {
  29.         SendCopyData(GetWindowHandle(), u8"say Commend for Commend ♡");
  30.         Sleep(60000);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement