win32gui

Modal MFC dialog not shown due to idle checks in CWnd::RunModalLoop

亡梦爱人 提交于 2020-01-04 08:12:06
问题 Below I've put the source to CWnd::RunModal , which is the message loop run when you call CDialog::DoModal - it takes over as a nested message loop until the dialog is ended. Note that with a couple of special case exception ShowWindow is only called when the message queue is idle. This is causing a dialog not to appear for many seconds in some cases in our application when DoModal is called. If I debug into the code and put breakpoints, I see the phase 1 loop is not reached until this time.

How to get desktop item count in python?

匆匆过客 提交于 2020-01-03 13:55:11
问题 I'm trying to get the number of items on the desktop using win32gui in python 2.7. The following code: win32gui.SendMessage(win32gui.GetDesktopWindow(), LVM_GETITEMCOUNT) returns zero and I have no idea why. I wrote win32api.GetLastError() afterwards and it returned zero either. Thanks in advance. EDIT: I need to use this method because the final goal is to get the positions of the icons, and it's done by a similar method. So I just wanted to make sure that I know how to use this method. Also

Effect of MoveWindow in EnumChildWindows over listview inside the Dialog Box: Why ListView Header is not correctly scrolling

不问归期 提交于 2019-12-30 12:00:53
问题 I have a listview control (lvc) and it is inside a DialogBox (dbx) and that dbx also has a vertical scroll bar. Whenever the scrollbar is scrolled EnumChildWindows is called to enumerate all the child window of the dbx. The callback function contains a MoveWindow function that would move that lvc. lvc is scrolling fine but not its column headers, they are not moving with the list view. If i comment out the MoveWindow function inside the callback function then nothing changes. ( Off-course lvc

Another one about Win32 Vs UI Automation

坚强是说给别人听的谎言 提交于 2019-12-25 08:14:28
问题 I'm building a (Web/WinForms Application I didn't decide yet) and I have a running simple WinForms Application that I couldn't access through my new application by any means and I just want to read some values and maybe edit some values (Labels, Buttons, some trivial stuff). so I used Spy++ as advised in this question. So, I was able to see the values that I need to read/edit through this great tool. and I was able to edit some values (Like hide, Uncheck, Disable, etc on some labels and

How to Initialise a Handle

江枫思渺然 提交于 2019-12-24 03:48:15
问题 Error: Run-Time Check Failure #3 - The variable 'TextLabelVar' is being used without being initialized. Illustrative Code: HWND VarText; char Disps[100]; float some_number; WINAPI WndProc(..) { switch(...) case WM_CREATE: TextLabelVar=CreateWindowEx(WS_EX_WINDOWEDGE,TEXT("Edit"), TEXT("Val."), WS_CHILD \ | WS_VISIBLE, 380, 50, 140, 20, hwnd, NULL, NULL, NULL); break; case WM_MESSAGEFROMANOTHERWINDOW: some_number=1298.123123; sprintf(Disps,"%f",some_number); SetWindowText(TextLabelVar,TEXT

What factors control dialog button appearance?

不打扰是莪最后的温柔 提交于 2019-12-23 01:43:10
问题 I am a little confused on what are the factors that contribute to the appearance of the UI elements (like buttons) on windows dialogs. My confusion appears out of the following observations: 1- I have visual studio 2010 installed on my system and when I create a MFC dialog , the buttons on the .rc have a sophisticated look , slightly rounded corners etc. when I build the MFC application same appearance comes in the resulting exe. 2- Now I get an application that is developed in VC 6, convert

Control displayed with an offset in Visual Studio 2013

孤人 提交于 2019-12-19 11:56:17
问题 Recently I have migrated my source code from Visual Studio 2010 to Visual Studio 2013. After building in Visual Studio 2013, controls are displayed with an offset (see image by clicking on the link below). Link to image Does anybody know what happens? 回答1: I Think issue was with the border frame thickness of dialog box. I changed the following property in project settings & that worked for me. Project Properties->Configuration Properties->General->Platefortoolset, set it to Visual Studio 2013

Prevent desktop sharing of a particular c# winforms or detect desktop sharing

荒凉一梦 提交于 2019-12-18 15:07:24
问题 While developing an examination software I have a requirement to prevent desktop sharing through applications like TeamViewer, AnyDesk, Ammyy Admin etc or at least detection of it. Our examination software is developed in C#, it's a winform renders question one by one. I don't think detection is that easy as their are so many ways to capture the screen Desktop Duplication API, BitBlt, Direct3D, DirectX, DirectShow and so many. So I started exploring for preventing my c# winform getting

How do I find position of a Win32 control/window relative to its parent window?

别来无恙 提交于 2019-12-17 16:03:40
问题 Given handle of a Win32 window, I need to find position of it relative to its parent window. I know several functions (e.g.; GetWindowRect() and GetClientRect()), but none of them explicitly return the desired coordinates. How do I do this? 回答1: The solution is using the combined power of GetWindowRect() and MapWindowPoints(). GetWindowRect() retrieves the coordinates of a window relative to the entire screen area you see on your monitor. We need to convert these absolute coordinates into

CreateCompatibleDC fails after calling it exactly 4,984 times

断了今生、忘了曾经 提交于 2019-12-13 19:28:03
问题 I've encountered a strange bug in my program. It's a little odd, as it occurs on exactly the 4984th call to the function. I've been tweaking this all day, and without fail, that's the number at which it fails. The code in question is a small convenience function which creates and returns a DC and Bitmap. The context of this little function is that it's a piece in my stab at a screen recorder, so it's getting called tons and tons of times. When I first noticed the error, after some sleuthing