winapi

Win32 : set default font and text color for rich edit

爱⌒轻易说出口 提交于 2021-02-08 03:40:06
问题 It should be an easy question but I was unable to find an answer on google: How to set a default font and color to a richedit using plain c++ and win32 ? 回答1: From MSDN: You can also use EM_SETCHARFORMAT and EM_GETCHARFORMAT messages to set and retrieve the character formatting of the insertion point, which is the formatting that is applied to any subsequently inserted characters. For example, if an application sets the default character formatting to bold and the user then types a character,

Why are my programs's tab controls rendering their background in a blocky way, but the standard Window dialogs are not?

我们两清 提交于 2021-02-08 03:30:24
问题 tl;dr for those who read the old question: new circumstances have caused me to look a little deeper and I've found that this affects bare Tab controls on their own; I've adjusted the question to compensate. If I should remove the old question text entirely, please let me know. Here is a screenshot from a program I'm working on to test a wrapper library I'm also working on: If you look closely, the window on the right appears blocky, while the window on the left (the standard Windows Explorer

How to catch SERVICE_CONTROL_SHUTDOWN code in Windows Service Program

纵然是瞬间 提交于 2021-02-07 20:30:54
问题 I’m working on programming a Windows service program recently. The problem I faced with while programming is that Windows OS doesn’t turn off normally when I install my program on it. It takes too long time to turn off the system. It seems my program is the cause for the problem. I tried to find a solution on the internet, and I found adding ‘SERVICE_CONTROL_SHUTDOWN’ to my code can be the solution. I did so, but my program doesn’t catch ‘SERVICE_CONTROL_SHUTDOWN’ and I don’t know why… Does

Windows Messages

安稳与你 提交于 2021-02-07 19:52:18
问题 I need send a custom windows message with a custom Id that another application will listen for. Is there any predefined range of message Id ' s that Windows reserve for internal messages, such as SQL Server does (up to 50.000 for Internal messages)? 回答1: The documentation says: Application-Defined Messages An application can create messages to be used by its own windows or to communicate with windows in other processes. If an application creates its own messages, the window procedure that

Windows Messages

[亡魂溺海] 提交于 2021-02-07 19:48:45
问题 I need send a custom windows message with a custom Id that another application will listen for. Is there any predefined range of message Id ' s that Windows reserve for internal messages, such as SQL Server does (up to 50.000 for Internal messages)? 回答1: The documentation says: Application-Defined Messages An application can create messages to be used by its own windows or to communicate with windows in other processes. If an application creates its own messages, the window procedure that

Windows Messages

戏子无情 提交于 2021-02-07 19:48:30
问题 I need send a custom windows message with a custom Id that another application will listen for. Is there any predefined range of message Id ' s that Windows reserve for internal messages, such as SQL Server does (up to 50.000 for Internal messages)? 回答1: The documentation says: Application-Defined Messages An application can create messages to be used by its own windows or to communicate with windows in other processes. If an application creates its own messages, the window procedure that

How to add Ⓒ symbol in resource file to support in Japanese Windows OS.

限于喜欢 提交于 2021-02-07 19:39:42
问题 I need to add copy right symbol Ⓒ in my resource file(.rc). When I add this symbol in '.rc' file and run the app on Japanese OS, it displays ? symbol instead. Below is my code line. LTEXT "Ⓒ 2017 Comapny Inc. All rights reserved.",IDC_COPYRIGHT,7,30,211,8 I tried editing this symbol on Japanese locale machine machine but still the issue was not resolved. Ⓒ symbol gets converted to ? symbol when I save the .rc file. On Japanese machine I see the above code as below: LTEXT "? 2017 Comapny Inc.

Correct way to register for pre-shutdown notification from C++

心已入冬 提交于 2021-02-07 18:15:28
问题 I write a local service application using C++ and I can't find the correct way of registering for a pre-shut-down notification (for OS later than Windows XP). I believe that SERVICE_CONTROL_PRESHUTDOWN notification has been added since Vista, but when you call SetServiceStatus do we need to specify: dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PRESHUTDOWN; or dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PRESHUTDOWN; 回答1: You cannot accept both a

Correct way to register for pre-shutdown notification from C++

无人久伴 提交于 2021-02-07 18:15:14
问题 I write a local service application using C++ and I can't find the correct way of registering for a pre-shut-down notification (for OS later than Windows XP). I believe that SERVICE_CONTROL_PRESHUTDOWN notification has been added since Vista, but when you call SetServiceStatus do we need to specify: dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_PRESHUTDOWN; or dwServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN | SERVICE_ACCEPT_PRESHUTDOWN; 回答1: You cannot accept both a

Get Disk Utilized by each process in c++ windows

大憨熊 提交于 2021-02-07 17:12:21
问题 I am trying to build a tool which is something similar to Task Manager. I was able to get the CPU and Memory of each processes, but I couldn't figure out the Disk statistics. I was able to get the I/O Read, Write bytes, but it includes all file, disk and network. How could I get only the Disk Utilized by each processes?? Otherwise is it possible to segregate the disk statistics from those I/O bytes? If yes, how could I do it? 来源: https://stackoverflow.com/questions/32948539/get-disk-utilized