Currently attempting to make a small .exe that will enable and disable Fountain of Colors when Spotify is open, since I only really want it open when Spotify is open. I'm trying to send Bangs using C++, and I have a near identical copy of the code provided in the "Developers" documentation section of the Rainmeter website, but it doesn't seem to work. Every time I invoke this function it prints the error Rainmeter window not found. The else statement is, quite literally, the only modification I've made to the version of the function available on the website. What am I doing incorrectly?
Code:
void SendBang(const WCHAR* bang) {HWND rmWnd = FindWindow(L"DummyRainWClass", NULL);if (rmWnd){COPYDATASTRUCT cds;cds.dwData = 1;cds.cbData = (DWORD)(wcslen(bang) + 1) * sizeof(WCHAR);cds.lpData = (void*)bang;// Send bang to the Rainmeter windowSendMessage(rmWnd, WM_COPYDATA, 0, (LPARAM)&cds);} else { std::cout << "Rainmeter window not found." << std::endl; }}
Statistics: Posted by Shimadacat — April 30th, 2024, 8:12 pm — Replies 3 — Views 76