win32gui

win32gui get the current active application name

我的梦境 提交于 2021-02-18 06:01:29
问题 I am just learning python and I am relativity new to it. I created the following script that will get the current active windows title and print it to the window. import win32gui windowTile = ""; while ( True ) : newWindowTile = win32gui.GetWindowText (win32gui.GetForegroundWindow()); if( newWindowTile != windowTile ) : windowTile = newWindowTile ; print( windowTile ); The above code snippet works. I am now trying to get the application name for the active window ( Foreground Window ) My

`SetWindowLong()` function doesn't change window style even after calling `SetWindowPos()`

故事扮演 提交于 2021-02-10 12:15:26
问题 I create the static control with the code below: hWnd = CreateWindowExW( 0, L"STATIC", Content.c_str(), SS_LEFT | WS_VISIBLE | WS_CHILD /*| SS_SUNKEN*/, 200, 120, 120, 40, hWndParent, NULL, hInstance, NULL); If I enable the SS_SUNKEN style in the creation code above, the created static control appears sunken successfully. But, what I'm trying to do is the change the control style after its creation. I tried this: void BaseWindowClass::AddStyle(DWORD NewStyle) { // NewStyle = 0x00001000 = SS

`SetWindowLong()` function doesn't change window style even after calling `SetWindowPos()`

梦想与她 提交于 2021-02-10 12:14:27
问题 I create the static control with the code below: hWnd = CreateWindowExW( 0, L"STATIC", Content.c_str(), SS_LEFT | WS_VISIBLE | WS_CHILD /*| SS_SUNKEN*/, 200, 120, 120, 40, hWndParent, NULL, hInstance, NULL); If I enable the SS_SUNKEN style in the creation code above, the created static control appears sunken successfully. But, what I'm trying to do is the change the control style after its creation. I tried this: void BaseWindowClass::AddStyle(DWORD NewStyle) { // NewStyle = 0x00001000 = SS

How To Handle NM_CUSTOMDRAW event to retrieve List items

南楼画角 提交于 2021-02-08 10:30:34
问题 I'm working on a win32/MFC project. I have a custom CListCtrl control that I must to add, from time to time, some strings of characters. I absolutely need to perform some manipulations on items dynamically added to my CListCtrl. Ultra-Basically, I need to: Detect adding of single elements; Retrieve _single items_ IMMEDIATELY AFTER(ideally, shortly after InsertItem() invocation); Store values of single items in a map, which I will use to perform other manipulations. I thought about doing this

Owner and Owned window Activation issue

假装没事ソ 提交于 2021-02-04 18:54:05
问题 In an experimental code, when creating three top level windows with hierarchical ownership I am seeing weird behavior when dismissing them in reverse order . Code: #include <Windows.h> LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { MSG msg; WNDCLASS wndClass; WCHAR className[] = L"OwnedWindowsWeirdness"; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.lpszMenuName = NULL;

win32 content changed but doesn't show update unless window is moved

巧了我就是萌 提交于 2021-01-28 02:46:26
问题 My win32 GUI content changes every second but it doesn't show update unless the window is manually moved. I tried to pop up a messagebox every second to trigger the window to refresh and it worked. Hence it proves that my content really changes but the window doesnt update. I want the window to refresh without popping up a messagebox everytime, is there a windows function for this? Thanks case WM_PAINT: RECT fingerprintSection; fingerprintSection.left=500; fingerprintSection.top=300;

win32 content changed but doesn't show update unless window is moved

▼魔方 西西 提交于 2021-01-27 21:54:13
问题 My win32 GUI content changes every second but it doesn't show update unless the window is manually moved. I tried to pop up a messagebox every second to trigger the window to refresh and it worked. Hence it proves that my content really changes but the window doesnt update. I want the window to refresh without popping up a messagebox everytime, is there a windows function for this? Thanks case WM_PAINT: RECT fingerprintSection; fingerprintSection.left=500; fingerprintSection.top=300;

Windows Magnifier Window Cause exception when setting MagSetImageScalingCallback

两盒软妹~` 提交于 2020-12-07 06:08:12
问题 I have been using a magnifier code from this github link : Magnify I am trying to set MagImageScaling callback and i was able to get the bitmap through this callback. Once the MagImageScaling Callback is set and if i try to move the window the the right side of the desktop. The Program throws an exception like this: Exception thrown at 0x00007FFDA8724452 (msvcrt.dll) in Magnify10.exe: 0xC0000005: Access violation reading location 0x000001749E708FA4. I'm not posting the complete code because