windows-messages


How to get WM_POWERBROADCAST message in CWinApp?

随声附和 提交于 2020-01-14 03:04:23
问题 I create the class that inherited CWinApp and this class has a timer (use a window timer). When PC go sleep mode and wake-up, timer callback is called exact time of wake-up. I want to make to not call the timer callback when PC is resuming from suspend. So I tried to use WM_POWERBROADCAST message. But this message didn't catch in PreTranslateMessage() API. Also I tried SetWindowLong() with my own API but still didn't catch the WM_POWERBROADCAST message. Is there any way to get WM

Disabling desktop composition causes flickering on Tab Control

对着背影说爱祢 提交于 2020-01-11 13:36:26
问题 When i disable desktop composition i get flickering/blinking whenever i hover the mouse over the tabs. This only happens when desktop composition is disabled. I have tried to cancel WM_ERASEBKGND message but it doesn't fix the problem. What is the solution to this problem? This is the example that i tried to use for MASM tab control. http://www.dreamincode.net/forums/index.php?app=core&module=attach&section=attach&attach_id=28600 The bin is already compiled. EDIT: After enabling the WS_EX

How do I stop Windows from blocking the program during a window drag or menu button being held down?

早过忘川 提交于 2020-01-09 07:33:13
问题 I am novice with Win32, and I have been pursuing a problem (if it can be called a problem at all) with Windows blocking your program's flow during the event when a user grabs the window title bar and moves it around the screen. I have no legitimate reason to solve this problem, except that it bothers me. A few possibilities include removing the frame altogether, but it seems an inconvenient hack. Some games (single player) do not find this a problem at all. I have read however, that

Adapt windows messages in this class

一曲冷凌霜 提交于 2020-01-07 08:27:06
问题 I would like to know if this code can be adapted to use it inside a normal class (Example: Form1 Class) to don't need subclassing a Control. Code is from BlueMonkMN here Capture the option selected by the user in a windows default contextmenu? Class MyTextBox : Inherits TextBox Public Enum ContextCommands WM_CUT = &H300 WM_COPY = &H301 WM_PASTE = &H302 End Enum Public Class ContextCommandEventArgs Inherits EventArgs Public Property Command As ContextCommands End Class Event OnCut(sender As

Canon SDK: Download latest picture taken by two devices to host

混江龙づ霸主 提交于 2020-01-05 05:35:10
问题 I'm writing an windows based application in Visual Studio 2010. My host PC is connected to two Canon EOS 600D. So far I managed two take a picture, download it directly (without a SD card) to the host PC and store the pictures under a specific name on the host. If I execute my code in a loop, it also works fine (the index of the loop specifies the camera and the destination file). In a next step I used OpenMP2.0 to speed up the loop (this is my first project with OpenMP). Now the pictures are

Get child window handles in C#

一世执手 提交于 2020-01-03 19:29:10
问题 I'm starting a process in C# and then sending Windows messages to that process with SendMessage. Usually I send the messages to Process.MainWindowHandle, but in some instances I might need to find a child window handle and send messages there instead. How would I do that in C# and what are the options for finding child windows (i.e. do a need to know the name of the window or are there other options)? 回答1: Take a look at EnumChildWindows (pinvoke.net) 来源: https://stackoverflow.com/questions

What's a good way to debug Windows message content and destination?

自闭症网瘾萝莉.ら 提交于 2020-01-02 15:29:45
问题 I'm working on an application that simulates a Windows mouse based on other behavior. One example is that pressing the + or - keys on the keyboard sends the WM_MOUSEWHEEL message to a target window with an appropriate delta. The problem is that in some situations I'm having a hard time replicating the messages that i think windows is sending to the target application. Are there any ways to record windows messages sent to a specific window (hopefully with a filter for which messages I want to

What's a good way to debug Windows message content and destination?

流过昼夜 提交于 2020-01-02 15:29:07
问题 I'm working on an application that simulates a Windows mouse based on other behavior. One example is that pressing the + or - keys on the keyboard sends the WM_MOUSEWHEEL message to a target window with an appropriate delta. The problem is that in some situations I'm having a hard time replicating the messages that i think windows is sending to the target application. Are there any ways to record windows messages sent to a specific window (hopefully with a filter for which messages I want to

Trying to write a better WndProc Handling

允我心安 提交于 2019-12-25 18:52:00
问题 I'm trying to write a better (I think is better) and reusable WndProc procedure, but the code below does not work because when I add more arguments to the sub firm it says that the sub does not accept that amount of arguments, of course that is reasonable. But I know that this trick can be done because I've seen this same wndproc sub with a lot of custom arguments time ago in some thirdparty classes which I don't remember where I've seen neither I don't remember how them did the trick. Then,

TB_GETBUTTONINFO fails on Windows 7

左心房为你撑大大i 提交于 2019-12-24 12:21:25
问题 I have some code like this: TBBUTTONINFO mtbbi; HWND hwnd; HANDLE hProc; DWORD dwProcessID; void* lpData; ..... GetWindowThreadProcessId(hwnd, &dwProcessID); hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, dwProcessID); lpData = VirtualAllocEx(hProc , 0, sizeof(TBBUTTONINFO), MEM_COMMIT, PAGE_READWRITE); memset(&mtbbi,0,sizeof(mtbbi)); mtbbi.cbSize=sizeof(TBBUTTONINFO); mtbbi.dwMask=TBIF_BYINDEX|TBIF_LPARAM; WriteProcessMemory(hProc,lpData,&mtbbi,sizeof(TBBUTTONINFO),&dwBytesRead); SendMessage

工具导航Map