Category : win32com

I have an issue with char buffer in windows7 machine. Previously we are using char buffer like this char_256 [256], now we have upgraded/created the char buffer with 512 and 1024 i.e char_512 [512], char_1024 [1024]. 512 and 1024 are working fine in windows 10, server12,16,19 machines, it is not working/application crashing in windows7 machines, ..

Read more

I have a Form with a CommandButton in my excel sheet and I would like to click it with my python script. Things that do NOT work: import win32com.client xl = win32com.client.Dispatch(‘Excel.Application’) xl.Workbooks.Open(file) xl.Application.Run(‘CommandButton.1’) I am guessing this does not work as it is not a macro import win32com.client xl = win32com.client.Dispatch(‘Excel.Application’) xl.Workbooks.Open(file) xl.DoCmd.OpenForms(‘CommandButton.1’) xl.Forms(‘CommandButton.1’).CommandButton_Click() ..

Read more

BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) //callback function { TCHAR str[255]; if (!hWnd){ return TRUE; // Not a window } if (IsWindowVisible(hWnd)) { if ((GetWindowLongPtr(hWnd, GWL_STYLE) & WS_ICONIC)) { return TRUE; // Window is minimized } if (GetWindowText(hWnd, str, 255)) { // LOGGER->info("In Screenshots detection, windows text: {}",wstringToString(str)); if (_wcsicmp(str, _T("Program Manager"))){ TCHAR proc_name[1024]; HANDLE ..

Read more

I am using this code its simple code but for some reason it always returning the partially covered despite the windows is fully covered or uncovered. I am using this in the EnumWindows HDC hdc = GetDC(hWnd); if (hdc) { RECT rcClip, rcClient; switch (GetClipBox(hdc, &rcClip)) { case NULLREGION: LOGGER->info("completely covered"); break; case SIMPLEREGION: GetClientRect(hWnd, ..

Read more

// I am not getting the 2nd topmost Rect //Also is it correct the way i converted rect to hrgn RECT original, l,yo; HRGN rgn = CreateRectRgn(0, 0, 0, 0); HWND hwnd_owner = GetForegroundWindow(); //getting foreground for topmost window HWND p = GetWindow(hwnd_owner, GW_HWNDNEXT); //getting second topmost window GetClientRect(p, &original); //getting rect using handler GetClientRect(hwnd_owner, ..

Read more