Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Saturday, September 17, 2011

Windows API tabbing

To get tabbing between controls working two steps are necessary:

1. The WS_TABSTOP window style must be or'd onto all controls that are to be tab stops.

2. The TranslateMessage/DispatchMessage bit in your GetMessage loop in WinMain should have this condition put round it:

if (!IsDialogMessage(hwnd, &msg)) ...

(hwnd being the handle you got back from CreateWindow and msg being the MSG structure you gave GetMessage a pointer to - see the minimal mingw app)

This stops 'dialogue' messages (which despite their name are useful in any window that contains controls [MSDN]) from being sent to your WindowProc callback. IsDialogMessage doesn't just check the message type; if it detects a dialogue message, it also translates and dispatches it to make the tabbing happen. And that's why the message must not be dispatched to your WindowProc.

Having done all this you should find tabbing miraculously taking place between the controls.

Followers

Blog Archive