I have a problem with Aero Snap not working with the application I'm working on (Windows desktop, native C ++ application), and I'm a bit confused as to what is happening, as it seems like it should just work, out of the box .
I used Spy ++ in the win32 gadget and get the following messages when I click Win-Left:
<00070> 00030D1C P WM_KEYDOWN nVirtKey: VK_LWIN cRepeat: 1 ScanCode: 5B fRepeat: 0 fUp: 0 <00071> 00030D1C P WM_KEYDOWN nVirtKey: VK_LWIN cRepeat: 1 ScanCode: 5B fRepeat: 1 fUpkt 000KWKW 000KDVEYKEY 00072> 000PKV0000 VK_LWIN cRepeat: 1 ScanCode: 5B fRepeat: 1 fUp: 0 <00088> 00030D1C S WM_GETMINMAXINFO lpmmi: 0043FCBC
<00089> 00030D1C R WM_GETMINMAXINFO lpmmi: 0043FCBC
<00090> 00030D1C S WM_WINDOWPOSCHANGING lpwp: 0043FCC4
<00091> 00030D1C S WM_GETMINMAXINFO lpmmi: 0043F8E8
<00092> 00030D1C R WM_GETMINMAXINFO lpmmi: 0043F8E8
<00093> 00030D1C R WM_WINDOWPOSCHANGING
.. etc.
So, I see that WM_KEYDOWN for the left key does not reach the application, but instead I get an "resize window" aerobic binding.
When I Spy ++ my application, I see that the left key is not "intercepted", but instead is passed to the application, so I do not get any grabbing.
<00043> 000F0F12 P WM_KEYDOWN nVirtKey: VK_LWIN cRepeat: 1 ScanCode: 5B fRepeat: 0 fUp: 0
<00044> 000F0F12 P WM_KEYDOWN nVirtKey: VK_LWIN cRepeat: 1 ScanCode: 5B fRepeat: 1 fUp: 0
<00045> 000F0F12 P WM_KEYDOWN nVirtKey: VK_LWIN cRepeat: 1 ScanCode: 5B fRepeat: 1 fUp: 0
<00060> 000F0F12 P WM_KEYUP nVirtKey: VK_LEFT cRepeat: 1 ScanCode: 4B fRepeat: 0 fUp: 1
I'm going to delve into the messaging engine and see what happens, but I'll take all the tips I can get :)
Change I noticed that Win-Up and Win-Shift-Left / Right actually work correctly, so it is just Win-Down and Win-Left / Right that are not “disconnected” to the correct position / size.
Edit Well, the problem is that my window was not created using the WS_THICKFRAME icon. If I add a flag, click the works. Now I really do not want the border there, but at least I know what caused the strange behavior.
Hope final editing . Getting rid of the border was as simple as replying to WM_NCCALCSIZE, and getting the client to occupy the entire window.
c ++ windows-7 winapi aero
Magnus Österlind
source share