#include "pch.h" #include <windows.h> #include <commctrl.h> #include <mmdeviceapi.h>…
- User
#include "pch.h" #include <windows.h> #include <commctrl.h> #include <mmdeviceapi.h> #include <endpointvolume.h> #include
HINSTANCE hInst; HWND hSlider; IAudioEndpointVolume* pVolume = NULL; HWND hWnd = NULL; // Store the window handle
bool isWindowVisible = true; // Track window visibility
void SetMicrophoneGain(float gain) { if (pVolume) { pVolume->SetMasterVolumeLevelScalar(gain / 300.0f, NULL); } }
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_HSCROLL: if ((HWND)lParam == hSlider) { int gainValue = SendMessage(hSlider, TBM_GETPOS, 0, 0); SetMicrophoneGain((float)gainValue); } break; case WM_CREATE: SetLayeredWindowAttributes(hWnd, 0, (BYTE)(255 * 0.6), LWA_ALPHA); // You can remove or adjust this for transparency break; case WM_DESTROY: PostQuitMessage(0); break; case WM_KEYDOWN: if (wParam == VK_F3) { ShowWindow(hWnd, SW_HIDE); // Hide the window when F3 is pressed isWindowVisible = false; } else if (wParam == VK_F4) { if (!isWindowVisible) { ShowWindow(hWnd, SW_RESTORE); // Restore the window if it's minimized SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); // Bring to the top UpdateWindow(hWnd); // Force the window to redraw isWindowVisible = true; } } break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
DWORD WINAPI CreateGUI(LPVOID lpParam) { WNDCLASS wc = { 0 }; wc.lpfnWndProc = WndProc; wc.hInstance = hInst; wc.lpszClassName = L"DiscordGainGUI"; wc.hbrBackground = CreateSolidBrush(RGB(30, 30, 30)); // Dark background RegisterClass(&wc);
hWnd = CreateWindowEx(WS_EX_LAYERED, L"DiscordGainGUI", L"Jakacord", WS_OVERLAPPED | WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, 400, 200, NULL, NULL, hInst, NULL); hSlider = CreateWindow(TRACKBAR_CLASS, NULL, WS_CHILD | WS_VISIBLE | TBS_HORZ, 50, 80, 300, 30, hWnd, NULL, hInst, NULL); SendMessage(hSlider, TBM_SETRANGE, TRUE, MAKELPARAM(0, 200)); SendMessage(hSlider, TBM_SETPOS, TRUE, 100); SetLayeredWindowAttributes(hWnd, 0, (BYTE)(255 * 0.7), LWA_ALPHA); // 70% Transparency (optional) ShowWindow(hWnd, SW_SHOW); UpdateWindow(hWnd); MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0;}
void InitializeAudio() { CoInitialize(NULL); IMMDeviceEnumerator* pEnumerator = NULL; IMMDevice* pDevice = NULL; CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&pEnumerator); if (pEnumerator) { pEnumerator->GetDefaultAudioEndpoint(eCapture, eConsole, &pDevice); if (pDevice) { pDevice->Activate(__uuidof(IAudioEndpointVolume), CLSCTX_ALL, NULL, (void**)&pVolume); pDevice->Release(); } pEnumerator->Release(); } }
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { if (ul_reason_for_call == DLL_PROCESS_ATTACH) { hInst = hModule; AllocConsole(); FILE* f; freopen_s(&f, "CONOUT$", "w", stdout); std::cout << "Injected Successfully" << std::endl; InitializeAudio(); CreateThread(NULL, 0, CreateGUI, NULL, 0, NULL); } return TRUE; }
- Assistant
- User
full code
- Assistant
- User
when i press either of the key it does not work
- Assistant
- User
ok just remove the f3 and f4 functions add a function on the gui where i can hide the menu from screenshares like on discord and screenshots and like recordings but i can still see but when i press hide menu button back people can see it
- Assistant
- User
i hid it how am i supposed to unhide it
- Assistant
- User
i cant drag the menu for some reason
- Assistant
- User
remove hide button and add minimize maximize and close out button
- Assistant
- User
no like at the top and close add the drag feature back
- Assistant
- User
when i minimize and go back dont make the menu big again only when i maximize
- Assistant