318 questions
0
votes
0
answers
93
views
How to end SC_SIZE command (resizing of the window) with Right Mouse Button release?
I have a WINAPI application and I want the user to be able to resize the window with the Right Mouse Button.
Calling SendMessage(hwnd, WM_SYSCOMMAND, SC_SIZE + WMSZ_BOTTOMRIGHT, 0); in a ...
1
vote
1
answer
106
views
WM_LBUTTONDOWN delay issue in WinAPI
This is a follow-up to my previous question.
How to handle button held down in WinAPI?
I managed to get the button to update counter continuously while the button is depressed, based on the comments I ...
0
votes
1
answer
228
views
Why does my pywin32 SendMessage doesn't work?
I am trying to understand python's capability to use Windows Messages with pywin32 library. For this I have created 2 scripts that are supposed to run parralel to each other. One is a client that is ...
1
vote
0
answers
124
views
BEGIN_MESSAGE_MAP vs Dispatch vs WndProc
After reading a lot on this, I came to conclusion that these 3 are essentially the same things of processing custom messages:
Using BEGIN_MESSAGE_MAP macro:
#define WM_CUSTOM_MESSAGE WM_APP + 12345
...
0
votes
0
answers
148
views
Rust window created with CreateWindowExW() does not receive winEventHook messages
So I setup windows hook for EVENT_SYSTEM_FOREGROUND event then in order to receive events from windows there must be message loop in the same thread, this requires setting up a window or using ...
0
votes
1
answer
108
views
Can Send message properly, but can't receive them in winapi
This is a code designed to roughly estimate the time it takes from the moment of asking the Windows OS to queue a message into a window's queue, till the window's thread is actually given CPU time. ...
0
votes
1
answer
64
views
Passing TMessage as a one-liner
I use C++ Builder and I pass messages to window which are handled in WndProc to update user interface. Something like:
struct TWmGuiUpdatedStruct
{
int id1;
int id2;
};
...
3
votes
0
answers
353
views
Preventing Windows shutdown in Rust
I'm trying to require a user to confirm a Windows shutdown while my program is performing critical tasks.
In order to do this, I want to listen for a WM_QUERYENDSESSION message (in a seperate thread ...
0
votes
1
answer
303
views
Intercepting Window status, position etc. in Firemonkey
I have user-friendliness in mind, so I'd like to intercept the position of each form I'm opening, to store and retrieve each time the same form is opened again.
Because I plan to port this for MAC, I ...
-1
votes
2
answers
129
views
How does the lParam parameter within NMLISTVIEW get set?
According to https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlistview lParam is of Type: LPARAM and is a Application-defined value of the item. This member is undefined for ...
0
votes
0
answers
28
views
Unexpected behavior when sending a personalized message
Create an application with two forms, where the main form is created automatically, and the second form is created as needed. I've defined a custom message to pass a certain parameter from the ...
2
votes
2
answers
1k
views
How to add tray icon in a C++ console program?
I am developing a console program and I have planned to add a tray icon for it. But it seems that only Win32 GUI program can do something caused by messages. (WndProc())
My message checking loop code ...
0
votes
0
answers
102
views
Failed to intercept WM_LBUTTONUP message with WH_GETMESSAGE or WH_MOUSE_LL
In development of GUI automation service, our team faces with the problem that we can not handle WM_LBUTTONUP message correct.
The goal is to intercept WM_LBUTTONUP, disable active window, do our job ...
0
votes
1
answer
4k
views
How to use SendMessage pass a WM_COMMAND with hwnd?
I got a WM_COMMAND in a button event by Spy++, It looks like:
<000116> 001B0A02 S WM_NOTIFY idCtrl:133978 pnmh:0019F9A0
<000117> 001B0A02 R WM_NOTIFY
<000118> 001B0A02 S WM_COMMAND ...
0
votes
1
answer
311
views
How to extract colors from NM_CUSTOMDRAW message in Win32?
I have a hooked dll with WH_CALLWNDPROC from a x86 program (MSVS 2017). The code goes as follows:
extern "C" __declspec(dllexport) LRESULT SysMessageProc(int nCode, WPARAM wParam, LPARAM ...
0
votes
1
answer
1k
views
Issues with handling ON_WM_NCPAINT() message and OnNCPaint() override. (Overriding default MFC window border) [2020]
I'm attempting to create a "dark mode" theme for my Windows app, and I'm experiencing some inconsistencies with overriding the OnNcPaint() function. Please pardon the giant red box. I'm only ...
2
votes
1
answer
319
views
Getting the numeric value of a given Windows message identifier
The WinAPI associates its messages, such as WM_GETTEXT, with ints, such as 13. Each message seems to have its own code.
Unfortunately, this list of codes is incomplete. For example, it lacks the code ...
0
votes
1
answer
182
views
a question about getting keyboard stroke on context menu
I am filtering keyboard messages delivered to a specific win32 application by hooking GetMessage/PeekMessage, it works fine except for context menu.
For example, when i right click blank area in ...
0
votes
0
answers
244
views
MFC: Not getting WM_CHAR in CDialogEx dialog?
I have a dialog with no controls derived from CDialogEx. I receive OnKeyDown() messages but never receive a OnChar() ? I even tried overriding PreTranslateMessage() and just returning 0 when ...
1
vote
1
answer
267
views
How to gracefully close this simple Windows GUI program? Because it doesn't (sometimes)
I'm having an issue with my Windows application where upon closing it from the taskbar or via hotkey it will occasionally hang. I'm wondering how to gracefully exit the following program:
LRESULT ...
1
vote
1
answer
447
views
Mouse click emulation problem when minimizing the application
I have application with the TWebBrowser component on the main form.
I need to emulate clicks in the TWebBrowser window and I use Windows messages for that.
I send WM_MOUSEMOVE, WM_SETCURSOR, ...
0
votes
0
answers
157
views
Using messages to notify TFrames they should refresh underlying datasets
I am using TFrames to split different parts of a form (visual elements and code) into different units. For example, if my form is an invoice, I have Frame#1 showing the client, invoice date and total ...
1
vote
0
answers
457
views
How/Why does KillTimer invalidate existing WM_TIMER messages?
I was reading this answer to a question about how to schedule a TIMERPROC to run immediately. I was interested in this as I need to run a method immediately after the caller has finished executing its ...
1
vote
1
answer
2k
views
How to discard some messages for a window?
My goal is to disable some tool-tip-like thing in window of another process. My thoughts are to block WM_MOUSEMOVE if the coordinates of mouse movement is in certain rectangle of the window.
I can ...
0
votes
1
answer
246
views
How to determine which window was moved/resized from WM_EXITSIZEMOVE message?
I've been processing all the numerous individual WM_MOVE, WM_SIZING, and WM_SIZE messages for a multiple-GUI/window application, but I've just learned of the WM_EXITSIZEMOVE message and would like to ...