+// ---------------------------------------------------------------------------
+// text metrics
+// ---------------------------------------------------------------------------
+
+int wxWindowMSW::GetCharHeight() const
+{
+ return wxGetTextMetrics(this).tmHeight;
+}
+
+int wxWindowMSW::GetCharWidth() const
+{
+ // +1 is needed because Windows apparently adds it when calculating the
+ // dialog units size in pixels
+#if wxDIALOG_UNIT_COMPATIBILITY
+ return wxGetTextMetrics(this).tmAveCharWidth;
+#else
+ return wxGetTextMetrics(this).tmAveCharWidth + 1;
+#endif
+}
+
+void wxWindowMSW::GetTextExtent(const wxString& string,
+ int *x, int *y,
+ int *descent, int *externalLeading,
+ const wxFont *theFont) const
+{
+ const wxFont *fontToUse = theFont;
+ if ( !fontToUse )
+ fontToUse = &m_font;
+
+ HWND hWnd = GetHwnd();
+ HDC dc = ::GetDC(hWnd);
+
+ HFONT fnt = 0;
+ HFONT hfontOld = 0;
+ if ( fontToUse && fontToUse->Ok() )
+ {
+ fnt = (HFONT)((wxFont *)fontToUse)->GetResourceHandle(); // const_cast
+ if ( fnt )
+ hfontOld = (HFONT)SelectObject(dc,fnt);
+ }
+
+ SIZE sizeRect;
+ TEXTMETRIC tm;
+ GetTextExtentPoint(dc, string, (int)string.Length(), &sizeRect);
+ GetTextMetrics(dc, &tm);
+
+ if ( fontToUse && fnt && hfontOld )
+ SelectObject(dc, hfontOld);
+
+ ReleaseDC(hWnd, dc);
+
+ if ( x )
+ *x = sizeRect.cx;
+ if ( y )
+ *y = sizeRect.cy;
+ if ( descent )
+ *descent = tm.tmDescent;
+ if ( externalLeading )
+ *externalLeading = tm.tmExternalLeading;
+}
+
+#if wxUSE_CARET && WXWIN_COMPATIBILITY
+// ---------------------------------------------------------------------------
+// Caret manipulation
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::CreateCaret(int w, int h)
+{
+ SetCaret(new wxCaret(this, w, h));
+}
+
+void wxWindowMSW::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
+{
+ wxFAIL_MSG("not implemented");
+}
+
+void wxWindowMSW::ShowCaret(bool show)
+{
+ wxCHECK_RET( m_caret, "no caret to show" );
+
+ m_caret->Show(show);
+}
+
+void wxWindowMSW::DestroyCaret()
+{
+ SetCaret(NULL);
+}
+
+void wxWindowMSW::SetCaretPos(int x, int y)
+{
+ wxCHECK_RET( m_caret, "no caret to move" );
+
+ m_caret->Move(x, y);
+}
+
+void wxWindowMSW::GetCaretPos(int *x, int *y) const
+{
+ wxCHECK_RET( m_caret, "no caret to get position of" );
+
+ m_caret->GetPosition(x, y);
+}
+#endif // wxUSE_CARET
+
+// ---------------------------------------------------------------------------
+// popup menu
+// ---------------------------------------------------------------------------
+
+// yield for WM_COMMAND events only, i.e. process all WM_COMMANDs in the queue
+// immediately, without waiting for the next event loop iteration
+//
+// NB: this function should probably be made public later as it can almost
+// surely replace wxYield() elsewhere as well
+static void wxYieldForCommandsOnly()
+{
+ // peek all WM_COMMANDs (it will always return WM_QUIT too but we don't
+ // want to process it here)
+ MSG msg;
+ while ( ::PeekMessage(&msg, (HWND)0, WM_COMMAND, WM_COMMAND, PM_REMOVE)
+ && msg.message != WM_QUIT )
+ {
+ wxTheApp->DoMessage((WXMSG *)&msg);
+ }
+}
+
+#if wxUSE_MENUS_NATIVE
+
+bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y)
+{
+ menu->SetInvokingWindow(this);
+ menu->UpdateUI();
+
+ HWND hWnd = GetHwnd();
+ HMENU hMenu = GetHmenuOf(menu);
+ POINT point;
+ point.x = x;
+ point.y = y;
+ ::ClientToScreen(hWnd, &point);
+ wxCurrentPopupMenu = menu;
+ ::TrackPopupMenu(hMenu, TPM_RIGHTBUTTON, point.x, point.y, 0, hWnd, NULL);
+
+ // we need to do it righ now as otherwise the events are never going to be
+ // sent to wxCurrentPopupMenu from HandleCommand()
+ //
+ // note that even eliminating (ugly) wxCurrentPopupMenu global wouldn't
+ // help and we'd still need wxYieldForCommandsOnly() as the menu may be
+ // destroyed as soon as we return (it can be a local variable in the caller
+ // for example) and so we do need to process the event immediately
+ wxYieldForCommandsOnly();
+
+ wxCurrentPopupMenu = NULL;
+
+ menu->SetInvokingWindow(NULL);
+
+ return TRUE;
+}
+
+#endif // wxUSE_MENUS_NATIVE
+
+// ===========================================================================
+// pre/post message processing
+// ===========================================================================
+
+long wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ if ( m_oldWndProc )
+ return ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
+ else
+ return ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam);
+}
+
+bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
+{
+ // wxUniversal implements tab traversal itself
+#ifndef __WXUNIVERSAL__
+ if ( m_hWnd != 0 && (GetWindowStyleFlag() & wxTAB_TRAVERSAL) )
+ {
+ // intercept dialog navigation keys
+ MSG *msg = (MSG *)pMsg;
+
+ // here we try to do all the job which ::IsDialogMessage() usually does
+ // internally
+#if 1
+ bool bProcess = TRUE;
+ if ( msg->message != WM_KEYDOWN )
+ bProcess = FALSE;
+
+ if ( bProcess && (HIWORD(msg->lParam) & KF_ALTDOWN) == KF_ALTDOWN )
+ bProcess = FALSE;
+
+ if ( bProcess )
- case WM_MBUTTONDOWN:
- {
- int x = (DIMENSION_TYPE) LOWORD(lParam);
- int y = (DIMENSION_TYPE) HIWORD(lParam);
- MSWOnMButtonDown(x, y, wParam);
+ }
+#endif // __WXUNIVERSAL__
+
+#if wxUSE_TOOLTIPS
+ if ( m_tooltip )
+ {
+ // relay mouse move events to the tooltip control
+ MSG *msg = (MSG *)pMsg;
+ if ( msg->message == WM_MOUSEMOVE )
+ m_tooltip->RelayEvent(pMsg);
+ }
+#endif // wxUSE_TOOLTIPS
+
+ return FALSE;
+}
+
+bool wxWindowMSW::MSWTranslateMessage(WXMSG* pMsg)
+{
+#if wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
+ return m_acceleratorTable.Translate(this, pMsg);
+#else
+ return FALSE;
+#endif // wxUSE_ACCEL
+}
+
+// ---------------------------------------------------------------------------
+// message params unpackers (different for Win16 and Win32)
+// ---------------------------------------------------------------------------
+
+#ifdef __WIN32__
+
+void wxWindowMSW::UnpackCommand(WXWPARAM wParam, WXLPARAM lParam,
+ WORD *id, WXHWND *hwnd, WORD *cmd)
+{
+ *id = LOWORD(wParam);
+ *hwnd = (WXHWND)lParam;
+ *cmd = HIWORD(wParam);
+}
+
+void wxWindowMSW::UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *state, WXWORD *minimized, WXHWND *hwnd)
+{
+ *state = LOWORD(wParam);
+ *minimized = HIWORD(wParam);
+ *hwnd = (WXHWND)lParam;
+}
+
+void wxWindowMSW::UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *code, WXWORD *pos, WXHWND *hwnd)
+{
+ *code = LOWORD(wParam);
+ *pos = HIWORD(wParam);
+ *hwnd = (WXHWND)lParam;
+}
+
+void wxWindowMSW::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
+{
+#ifndef __WXMICROWIN__
+ *nCtlColor = CTLCOLOR_BTN;
+ *hwnd = (WXHWND)lParam;
+ *hdc = (WXHDC)wParam;
+#endif
+}
+
+void wxWindowMSW::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *item, WXWORD *flags, WXHMENU *hmenu)
+{
+ *item = (WXWORD)wParam;
+ *flags = HIWORD(wParam);
+ *hmenu = (WXHMENU)lParam;
+}
+
+#else // Win16
+
+void wxWindowMSW::UnpackCommand(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *id, WXHWND *hwnd, WXWORD *cmd)
+{
+ *id = (WXWORD)wParam;
+ *hwnd = (WXHWND)LOWORD(lParam);
+ *cmd = HIWORD(lParam);
+}
+
+void wxWindowMSW::UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *state, WXWORD *minimized, WXHWND *hwnd)
+{
+ *state = (WXWORD)wParam;
+ *minimized = LOWORD(lParam);
+ *hwnd = (WXHWND)HIWORD(lParam);
+}
+
+void wxWindowMSW::UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *code, WXWORD *pos, WXHWND *hwnd)
+{
+ *code = (WXWORD)wParam;
+ *pos = LOWORD(lParam);
+ *hwnd = (WXHWND)HIWORD(lParam);
+}
+
+void wxWindowMSW::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
+{
+ *hwnd = (WXHWND)LOWORD(lParam);
+ *nCtlColor = (int)HIWORD(lParam);
+ *hdc = (WXHDC)wParam;
+}
+
+void wxWindowMSW::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *item, WXWORD *flags, WXHMENU *hmenu)
+{
+ *item = (WXWORD)wParam;
+ *flags = LOWORD(lParam);
+ *hmenu = (WXHMENU)HIWORD(lParam);
+}
+
+#endif // Win32/16
+
+// ---------------------------------------------------------------------------
+// Main wxWindows window proc and the window proc for wxWindow
+// ---------------------------------------------------------------------------
+
+// Hook for new window just as it's being created, when the window isn't yet
+// associated with the handle
+wxWindowMSW *wxWndHook = NULL;
+
+// Main window proc
+LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ // trace all messages - useful for the debugging
+#ifdef __WXDEBUG__
+ wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
+ wxGetMessageName(message), wParam, lParam);
+#endif // __WXDEBUG__
+
+ wxWindowMSW *wnd = wxFindWinFromHandle((WXHWND) hWnd);
+
+ // when we get the first message for the HWND we just created, we associate
+ // it with wxWindow stored in wxWndHook
+ if ( !wnd && wxWndHook )
+ {
+#if 0 // def __WXDEBUG__
+ char buf[512];
+ ::GetClassNameA((HWND) hWnd, buf, 512);
+ wxString className(buf);
+#endif
+
+ wxAssociateWinWithHandle(hWnd, wxWndHook);
+ wnd = wxWndHook;
+ wxWndHook = NULL;
+ wnd->SetHWND((WXHWND)hWnd);
+ }
+
+ LRESULT rc;
+
+ // Stop right here if we don't have a valid handle in our wxWindow object.
+ if ( wnd && !wnd->GetHWND() )
+ {
+ // FIXME: why do we do this?
+ wnd->SetHWND((WXHWND) hWnd);
+ rc = wnd->MSWDefWindowProc(message, wParam, lParam );
+ wnd->SetHWND(0);
+ }
+ else
+ {
+ if ( wnd )
+ rc = wnd->MSWWindowProc(message, wParam, lParam);
+ else
+ rc = DefWindowProc( hWnd, message, wParam, lParam );
+ }
+
+ return rc;
+}
+
+long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+{
+ // did we process the message?
+ bool processed = FALSE;
+
+ // the return value
+ union
+ {
+ bool allow;
+ long result;
+ WXHICON hIcon;
+ WXHBRUSH hBrush;
+ } rc;
+
+ // for most messages we should return 0 when we do process the message
+ rc.result = 0;
+
+ switch ( message )
+ {
+ case WM_CREATE:
+ {
+ bool mayCreate;
+ processed = HandleCreate((WXLPCREATESTRUCT)lParam, &mayCreate);
+ if ( processed )
+ {
+ // return 0 to allow window creation
+ rc.result = mayCreate ? 0 : -1;
+ }
+ }
+ break;
+
+ case WM_DESTROY:
+ processed = HandleDestroy();
+ break;
+
+ case WM_MOVE:
+ processed = HandleMove(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+ break;
+
+ case WM_SIZE:
+ switch ( wParam )
+ {
+ case SIZE_MAXHIDE:
+ case SIZE_MAXSHOW:
+ // we're not interested in these messages at all
+ break;
+
+ case SIZE_MINIMIZED:
+ // we shouldn't send sizev events for these messages as the
+ // client size may be negative which breaks existing code
+ //
+ // OTOH we might send another (wxMinimizedEvent?) one or
+ // add an additional parameter to wxSizeEvent if this is
+ // useful to anybody
+ break;
+
+ default:
+ wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
+ // fall through nevertheless
+
+ case SIZE_MAXIMIZED:
+ case SIZE_RESTORED:
+ processed = HandleSize(LOWORD(lParam), HIWORD(lParam),
+ wParam);
+ }
-// If nothing defined for this, try the parent.
-// E.g. we may be a button loaded from a resource, with no callback function
-// defined.
-void wxWindow::OnCommand(wxWindow& win, wxCommandEvent& event)
-{
- if (GetEventHandler()->ProcessEvent(event) )
- return;
- if (m_windowParent)
- m_windowParent->GetEventHandler()->OnCommand(win, event);
-}
-
-void wxWindow::SetConstraints(wxLayoutConstraints *c)
-{
- if (m_constraints)
- {
- UnsetConstraints(m_constraints);
- delete m_constraints;
- }
- m_constraints = c;
- if (m_constraints)
- {
- // Make sure other windows know they're part of a 'meaningful relationship'
- if (m_constraints->left.GetOtherWindow() && (m_constraints->left.GetOtherWindow() != this))
- m_constraints->left.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->top.GetOtherWindow() && (m_constraints->top.GetOtherWindow() != this))
- m_constraints->top.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->right.GetOtherWindow() && (m_constraints->right.GetOtherWindow() != this))
- m_constraints->right.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->bottom.GetOtherWindow() && (m_constraints->bottom.GetOtherWindow() != this))
- m_constraints->bottom.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->width.GetOtherWindow() && (m_constraints->width.GetOtherWindow() != this))
- m_constraints->width.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->height.GetOtherWindow() && (m_constraints->height.GetOtherWindow() != this))
- m_constraints->height.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->centreX.GetOtherWindow() && (m_constraints->centreX.GetOtherWindow() != this))
- m_constraints->centreX.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- if (m_constraints->centreY.GetOtherWindow() && (m_constraints->centreY.GetOtherWindow() != this))
- m_constraints->centreY.GetOtherWindow()->AddConstraintReference((wxWindow *)this);
- }
-}
-
-// This removes any dangling pointers to this window
-// in other windows' constraintsInvolvedIn lists.
-void wxWindow::UnsetConstraints(wxLayoutConstraints *c)
-{
- if (c)
- {
- if (c->left.GetOtherWindow() && (c->top.GetOtherWindow() != this))
- c->left.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->top.GetOtherWindow() && (c->top.GetOtherWindow() != this))
- c->top.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->right.GetOtherWindow() && (c->right.GetOtherWindow() != this))
- c->right.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->bottom.GetOtherWindow() && (c->bottom.GetOtherWindow() != this))
- c->bottom.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->width.GetOtherWindow() && (c->width.GetOtherWindow() != this))
- c->width.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->height.GetOtherWindow() && (c->height.GetOtherWindow() != this))
- c->height.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->centreX.GetOtherWindow() && (c->centreX.GetOtherWindow() != this))
- c->centreX.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- if (c->centreY.GetOtherWindow() && (c->centreY.GetOtherWindow() != this))
- c->centreY.GetOtherWindow()->RemoveConstraintReference((wxWindow *)this);
- }
-}
-
-// Back-pointer to other windows we're involved with, so if we delete
-// this window, we must delete any constraints we're involved with.
-void wxWindow::AddConstraintReference(wxWindow *otherWin)
-{
- if (!m_constraintsInvolvedIn)
- m_constraintsInvolvedIn = new wxList;
- if (!m_constraintsInvolvedIn->Member(otherWin))
- m_constraintsInvolvedIn->Append(otherWin);
-}
-
-// REMOVE back-pointer to other windows we're involved with.
-void wxWindow::RemoveConstraintReference(wxWindow *otherWin)
-{
- if (m_constraintsInvolvedIn)
- m_constraintsInvolvedIn->DeleteObject(otherWin);
-}
-
-// Reset any constraints that mention this window
-void wxWindow::DeleteRelatedConstraints(void)
-{
- if (m_constraintsInvolvedIn)
- {
- wxNode *node = m_constraintsInvolvedIn->First();
- while (node)
- {
- wxWindow *win = (wxWindow *)node->Data();
- wxNode *next = node->Next();
- wxLayoutConstraints *constr = win->GetConstraints();
-
- // Reset any constraints involving this window
- if (constr)
- {
- constr->left.ResetIfWin((wxWindow *)this);
- constr->top.ResetIfWin((wxWindow *)this);
- constr->right.ResetIfWin((wxWindow *)this);
- constr->bottom.ResetIfWin((wxWindow *)this);
- constr->width.ResetIfWin((wxWindow *)this);
- constr->height.ResetIfWin((wxWindow *)this);
- constr->centreX.ResetIfWin((wxWindow *)this);
- constr->centreY.ResetIfWin((wxWindow *)this);
- }
- delete node;
- node = next;
- }
- delete m_constraintsInvolvedIn;
- m_constraintsInvolvedIn = NULL;
- }
-}
-
-void wxWindow::SetSizer(wxSizer *sizer)
-{
- m_windowSizer = sizer;
- if (sizer)
- sizer->SetSizerParent((wxWindow *)this);
-}
-
-/*
- * New version
- */
-
-bool wxWindow::Layout(void)
-{
- if (GetConstraints())
- {
- int w, h;
- GetClientSize(&w, &h);
- GetConstraints()->width.SetValue(w);
- GetConstraints()->height.SetValue(h);
- }
-
- // If top level (one sizer), evaluate the sizer's constraints.
- if (GetSizer())
- {
- int noChanges;
- GetSizer()->ResetConstraints(); // Mark all constraints as unevaluated
- GetSizer()->LayoutPhase1(&noChanges);
- GetSizer()->LayoutPhase2(&noChanges);
- GetSizer()->SetConstraintSizes(); // Recursively set the real window sizes
- return TRUE;
- }
- else
- {
- // Otherwise, evaluate child constraints
- ResetConstraints(); // Mark all constraints as unevaluated
- DoPhase(1); // Just one phase need if no sizers involved
- DoPhase(2);
- SetConstraintSizes(); // Recursively set the real window sizes
- }
- return TRUE;
-}
-
-
-// Do a phase of evaluating constraints:
-// the default behaviour. wxSizers may do a similar
-// thing, but also impose their own 'constraints'
-// and order the evaluation differently.
-bool wxWindow::LayoutPhase1(int *noChanges)
-{
- wxLayoutConstraints *constr = GetConstraints();
- if (constr)
- {
- return constr->SatisfyConstraints((wxWindow *)this, noChanges);
- }
- else
- return TRUE;
-}
+ case MM_JOY1ZMOVE:
+ joystick = 1;
+ eventType = wxEVT_JOY_ZMOVE;
+ break;
+
+ case MM_JOY2ZMOVE:
+ joystick = 2;
+ eventType = wxEVT_JOY_ZMOVE;
+ break;
+
+ case MM_JOY1BUTTONDOWN:
+ joystick = 1;
+ eventType = wxEVT_JOY_BUTTON_DOWN;
+ break;
+
+ case MM_JOY2BUTTONDOWN:
+ joystick = 2;
+ eventType = wxEVT_JOY_BUTTON_DOWN;
+ break;
+
+ case MM_JOY1BUTTONUP:
+ joystick = 1;
+ eventType = wxEVT_JOY_BUTTON_UP;
+ break;
- switch ( message ) {
- case 0x0000: return "WM_NULL";
- case 0x0001: return "WM_CREATE";
- case 0x0002: return "WM_DESTROY";
- case 0x0003: return "WM_MOVE";
- case 0x0005: return "WM_SIZE";
- case 0x0006: return "WM_ACTIVATE";
- case 0x0007: return "WM_SETFOCUS";
- case 0x0008: return "WM_KILLFOCUS";
- case 0x000A: return "WM_ENABLE";
- case 0x000B: return "WM_SETREDRAW";
- case 0x000C: return "WM_SETTEXT";
- case 0x000D: return "WM_GETTEXT";
- case 0x000E: return "WM_GETTEXTLENGTH";
- case 0x000F: return "WM_PAINT";
- case 0x0010: return "WM_CLOSE";
- case 0x0011: return "WM_QUERYENDSESSION";
- case 0x0012: return "WM_QUIT";
- case 0x0013: return "WM_QUERYOPEN";
- case 0x0014: return "WM_ERASEBKGND";
- case 0x0015: return "WM_SYSCOLORCHANGE";
- case 0x0016: return "WM_ENDSESSION";
- case 0x0017: return "WM_SYSTEMERROR";
- case 0x0018: return "WM_SHOWWINDOW";
- case 0x0019: return "WM_CTLCOLOR";
- case 0x001A: return "WM_WININICHANGE";
- case 0x001B: return "WM_DEVMODECHANGE";
- case 0x001C: return "WM_ACTIVATEAPP";
- case 0x001D: return "WM_FONTCHANGE";
- case 0x001E: return "WM_TIMECHANGE";
- case 0x001F: return "WM_CANCELMODE";
- case 0x0020: return "WM_SETCURSOR";
- case 0x0021: return "WM_MOUSEACTIVATE";
- case 0x0022: return "WM_CHILDACTIVATE";
- case 0x0023: return "WM_QUEUESYNC";
- case 0x0024: return "WM_GETMINMAXINFO";
- case 0x0026: return "WM_PAINTICON";
- case 0x0027: return "WM_ICONERASEBKGND";
- case 0x0028: return "WM_NEXTDLGCTL";
- case 0x002A: return "WM_SPOOLERSTATUS";
- case 0x002B: return "WM_DRAWITEM";
- case 0x002C: return "WM_MEASUREITEM";
- case 0x002D: return "WM_DELETEITEM";
- case 0x002E: return "WM_VKEYTOITEM";
- case 0x002F: return "WM_CHARTOITEM";
- case 0x0030: return "WM_SETFONT";
- case 0x0031: return "WM_GETFONT";
- case 0x0037: return "WM_QUERYDRAGICON";
- case 0x0039: return "WM_COMPAREITEM";
- case 0x0041: return "WM_COMPACTING";
- case 0x0044: return "WM_COMMNOTIFY";
- case 0x0046: return "WM_WINDOWPOSCHANGING";
- case 0x0047: return "WM_WINDOWPOSCHANGED";
- case 0x0048: return "WM_POWER";
+ switch ( message )
+ {
+ case 0x0000: return "WM_NULL";
+ case 0x0001: return "WM_CREATE";
+ case 0x0002: return "WM_DESTROY";
+ case 0x0003: return "WM_MOVE";
+ case 0x0005: return "WM_SIZE";
+ case 0x0006: return "WM_ACTIVATE";
+ case 0x0007: return "WM_SETFOCUS";
+ case 0x0008: return "WM_KILLFOCUS";
+ case 0x000A: return "WM_ENABLE";
+ case 0x000B: return "WM_SETREDRAW";
+ case 0x000C: return "WM_SETTEXT";
+ case 0x000D: return "WM_GETTEXT";
+ case 0x000E: return "WM_GETTEXTLENGTH";
+ case 0x000F: return "WM_PAINT";
+ case 0x0010: return "WM_CLOSE";
+ case 0x0011: return "WM_QUERYENDSESSION";
+ case 0x0012: return "WM_QUIT";
+ case 0x0013: return "WM_QUERYOPEN";
+ case 0x0014: return "WM_ERASEBKGND";
+ case 0x0015: return "WM_SYSCOLORCHANGE";
+ case 0x0016: return "WM_ENDSESSION";
+ case 0x0017: return "WM_SYSTEMERROR";
+ case 0x0018: return "WM_SHOWWINDOW";
+ case 0x0019: return "WM_CTLCOLOR";
+ case 0x001A: return "WM_WININICHANGE";
+ case 0x001B: return "WM_DEVMODECHANGE";
+ case 0x001C: return "WM_ACTIVATEAPP";
+ case 0x001D: return "WM_FONTCHANGE";
+ case 0x001E: return "WM_TIMECHANGE";
+ case 0x001F: return "WM_CANCELMODE";
+ case 0x0020: return "WM_SETCURSOR";
+ case 0x0021: return "WM_MOUSEACTIVATE";
+ case 0x0022: return "WM_CHILDACTIVATE";
+ case 0x0023: return "WM_QUEUESYNC";
+ case 0x0024: return "WM_GETMINMAXINFO";
+ case 0x0026: return "WM_PAINTICON";
+ case 0x0027: return "WM_ICONERASEBKGND";
+ case 0x0028: return "WM_NEXTDLGCTL";
+ case 0x002A: return "WM_SPOOLERSTATUS";
+ case 0x002B: return "WM_DRAWITEM";
+ case 0x002C: return "WM_MEASUREITEM";
+ case 0x002D: return "WM_DELETEITEM";
+ case 0x002E: return "WM_VKEYTOITEM";
+ case 0x002F: return "WM_CHARTOITEM";
+ case 0x0030: return "WM_SETFONT";
+ case 0x0031: return "WM_GETFONT";
+ case 0x0037: return "WM_QUERYDRAGICON";
+ case 0x0039: return "WM_COMPAREITEM";
+ case 0x0041: return "WM_COMPACTING";
+ case 0x0044: return "WM_COMMNOTIFY";
+ case 0x0046: return "WM_WINDOWPOSCHANGING";
+ case 0x0047: return "WM_WINDOWPOSCHANGED";
+ case 0x0048: return "WM_POWER";
- // common controls messages - although they're not strictly speaking
- // standard, it's nice to decode them nevertheless
-
- // listview
- case 0x1000 + 0: return "LVM_GETBKCOLOR";
- case 0x1000 + 1: return "LVM_SETBKCOLOR";
- case 0x1000 + 2: return "LVM_GETIMAGELIST";
- case 0x1000 + 3: return "LVM_SETIMAGELIST";
- case 0x1000 + 4: return "LVM_GETITEMCOUNT";
- case 0x1000 + 5: return "LVM_GETITEMA";
- case 0x1000 + 75: return "LVM_GETITEMW";
- case 0x1000 + 6: return "LVM_SETITEMA";
- case 0x1000 + 76: return "LVM_SETITEMW";
- case 0x1000 + 7: return "LVM_INSERTITEMA";
- case 0x1000 + 77: return "LVM_INSERTITEMW";
- case 0x1000 + 8: return "LVM_DELETEITEM";
- case 0x1000 + 9: return "LVM_DELETEALLITEMS";
- case 0x1000 + 10: return "LVM_GETCALLBACKMASK";
- case 0x1000 + 11: return "LVM_SETCALLBACKMASK";
- case 0x1000 + 12: return "LVM_GETNEXTITEM";
- case 0x1000 + 13: return "LVM_FINDITEMA";
- case 0x1000 + 83: return "LVM_FINDITEMW";
- case 0x1000 + 14: return "LVM_GETITEMRECT";
- case 0x1000 + 15: return "LVM_SETITEMPOSITION";
- case 0x1000 + 16: return "LVM_GETITEMPOSITION";
- case 0x1000 + 17: return "LVM_GETSTRINGWIDTHA";
- case 0x1000 + 87: return "LVM_GETSTRINGWIDTHW";
- case 0x1000 + 18: return "LVM_HITTEST";
- case 0x1000 + 19: return "LVM_ENSUREVISIBLE";
- case 0x1000 + 20: return "LVM_SCROLL";
- case 0x1000 + 21: return "LVM_REDRAWITEMS";
- case 0x1000 + 22: return "LVM_ARRANGE";
- case 0x1000 + 23: return "LVM_EDITLABELA";
- case 0x1000 + 118: return "LVM_EDITLABELW";
- case 0x1000 + 24: return "LVM_GETEDITCONTROL";
- case 0x1000 + 25: return "LVM_GETCOLUMNA";
- case 0x1000 + 95: return "LVM_GETCOLUMNW";
- case 0x1000 + 26: return "LVM_SETCOLUMNA";
- case 0x1000 + 96: return "LVM_SETCOLUMNW";
- case 0x1000 + 27: return "LVM_INSERTCOLUMNA";
- case 0x1000 + 97: return "LVM_INSERTCOLUMNW";
- case 0x1000 + 28: return "LVM_DELETECOLUMN";
- case 0x1000 + 29: return "LVM_GETCOLUMNWIDTH";
- case 0x1000 + 30: return "LVM_SETCOLUMNWIDTH";
- case 0x1000 + 31: return "LVM_GETHEADER";
- case 0x1000 + 33: return "LVM_CREATEDRAGIMAGE";
- case 0x1000 + 34: return "LVM_GETVIEWRECT";
- case 0x1000 + 35: return "LVM_GETTEXTCOLOR";
- case 0x1000 + 36: return "LVM_SETTEXTCOLOR";
- case 0x1000 + 37: return "LVM_GETTEXTBKCOLOR";
- case 0x1000 + 38: return "LVM_SETTEXTBKCOLOR";
- case 0x1000 + 39: return "LVM_GETTOPINDEX";
- case 0x1000 + 40: return "LVM_GETCOUNTPERPAGE";
- case 0x1000 + 41: return "LVM_GETORIGIN";
- case 0x1000 + 42: return "LVM_UPDATE";
- case 0x1000 + 43: return "LVM_SETITEMSTATE";
- case 0x1000 + 44: return "LVM_GETITEMSTATE";
- case 0x1000 + 45: return "LVM_GETITEMTEXTA";
- case 0x1000 + 115: return "LVM_GETITEMTEXTW";
- case 0x1000 + 46: return "LVM_SETITEMTEXTA";
- case 0x1000 + 116: return "LVM_SETITEMTEXTW";
- case 0x1000 + 47: return "LVM_SETITEMCOUNT";
- case 0x1000 + 48: return "LVM_SORTITEMS";
- case 0x1000 + 49: return "LVM_SETITEMPOSITION32";
- case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT";
- case 0x1000 + 51: return "LVM_GETITEMSPACING";
- case 0x1000 + 52: return "LVM_GETISEARCHSTRINGA";
- case 0x1000 + 117: return "LVM_GETISEARCHSTRINGW";
- case 0x1000 + 53: return "LVM_SETICONSPACING";
- case 0x1000 + 54: return "LVM_SETEXTENDEDLISTVIEWSTYLE";
- case 0x1000 + 55: return "LVM_GETEXTENDEDLISTVIEWSTYLE";
- case 0x1000 + 56: return "LVM_GETSUBITEMRECT";
- case 0x1000 + 57: return "LVM_SUBITEMHITTEST";
- case 0x1000 + 58: return "LVM_SETCOLUMNORDERARRAY";
- case 0x1000 + 59: return "LVM_GETCOLUMNORDERARRAY";
- case 0x1000 + 60: return "LVM_SETHOTITEM";
- case 0x1000 + 61: return "LVM_GETHOTITEM";
- case 0x1000 + 62: return "LVM_SETHOTCURSOR";
- case 0x1000 + 63: return "LVM_GETHOTCURSOR";
- case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT";
- case 0x1000 + 65: return "LVM_SETWORKAREA";
-
- // tree view
- case 0x1100 + 0: return "TVM_INSERTITEMA";
- case 0x1100 + 50: return "TVM_INSERTITEMW";
- case 0x1100 + 1: return "TVM_DELETEITEM";
- case 0x1100 + 2: return "TVM_EXPAND";
- case 0x1100 + 4: return "TVM_GETITEMRECT";
- case 0x1100 + 5: return "TVM_GETCOUNT";
- case 0x1100 + 6: return "TVM_GETINDENT";
- case 0x1100 + 7: return "TVM_SETINDENT";
- case 0x1100 + 8: return "TVM_GETIMAGELIST";
- case 0x1100 + 9: return "TVM_SETIMAGELIST";
- case 0x1100 + 10: return "TVM_GETNEXTITEM";
- case 0x1100 + 11: return "TVM_SELECTITEM";
- case 0x1100 + 12: return "TVM_GETITEMA";
- case 0x1100 + 62: return "TVM_GETITEMW";
- case 0x1100 + 13: return "TVM_SETITEMA";
- case 0x1100 + 63: return "TVM_SETITEMW";
- case 0x1100 + 14: return "TVM_EDITLABELA";
- case 0x1100 + 65: return "TVM_EDITLABELW";
- case 0x1100 + 15: return "TVM_GETEDITCONTROL";
- case 0x1100 + 16: return "TVM_GETVISIBLECOUNT";
- case 0x1100 + 17: return "TVM_HITTEST";
- case 0x1100 + 18: return "TVM_CREATEDRAGIMAGE";
- case 0x1100 + 19: return "TVM_SORTCHILDREN";
- case 0x1100 + 20: return "TVM_ENSUREVISIBLE";
- case 0x1100 + 21: return "TVM_SORTCHILDRENCB";
- case 0x1100 + 22: return "TVM_ENDEDITLABELNOW";
- case 0x1100 + 23: return "TVM_GETISEARCHSTRINGA";
- case 0x1100 + 64: return "TVM_GETISEARCHSTRINGW";
- case 0x1100 + 24: return "TVM_SETTOOLTIPS";
- case 0x1100 + 25: return "TVM_GETTOOLTIPS";
-
- // header
- case 0x1200 + 0: return "HDM_GETITEMCOUNT";
- case 0x1200 + 1: return "HDM_INSERTITEMA";
- case 0x1200 + 10: return "HDM_INSERTITEMW";
- case 0x1200 + 2: return "HDM_DELETEITEM";
- case 0x1200 + 3: return "HDM_GETITEMA";
- case 0x1200 + 11: return "HDM_GETITEMW";
- case 0x1200 + 4: return "HDM_SETITEMA";
- case 0x1200 + 12: return "HDM_SETITEMW";
- case 0x1200 + 5: return "HDM_LAYOUT";
- case 0x1200 + 6: return "HDM_HITTEST";
- case 0x1200 + 7: return "HDM_GETITEMRECT";
- case 0x1200 + 8: return "HDM_SETIMAGELIST";
- case 0x1200 + 9: return "HDM_GETIMAGELIST";
- case 0x1200 + 15: return "HDM_ORDERTOINDEX";
- case 0x1200 + 16: return "HDM_CREATEDRAGIMAGE";
- case 0x1200 + 17: return "HDM_GETORDERARRAY";
- case 0x1200 + 18: return "HDM_SETORDERARRAY";
- case 0x1200 + 19: return "HDM_SETHOTDIVIDER";
-
- // tab control
- case 0x1300 + 2: return "TCM_GETIMAGELIST";
- case 0x1300 + 3: return "TCM_SETIMAGELIST";
- case 0x1300 + 4: return "TCM_GETITEMCOUNT";
- case 0x1300 + 5: return "TCM_GETITEMA";
- case 0x1300 + 60: return "TCM_GETITEMW";
- case 0x1300 + 6: return "TCM_SETITEMA";
- case 0x1300 + 61: return "TCM_SETITEMW";
- case 0x1300 + 7: return "TCM_INSERTITEMA";
- case 0x1300 + 62: return "TCM_INSERTITEMW";
- case 0x1300 + 8: return "TCM_DELETEITEM";
- case 0x1300 + 9: return "TCM_DELETEALLITEMS";
- case 0x1300 + 10: return "TCM_GETITEMRECT";
- case 0x1300 + 11: return "TCM_GETCURSEL";
- case 0x1300 + 12: return "TCM_SETCURSEL";
- case 0x1300 + 13: return "TCM_HITTEST";
- case 0x1300 + 14: return "TCM_SETITEMEXTRA";
- case 0x1300 + 40: return "TCM_ADJUSTRECT";
- case 0x1300 + 41: return "TCM_SETITEMSIZE";
- case 0x1300 + 42: return "TCM_REMOVEIMAGE";
- case 0x1300 + 43: return "TCM_SETPADDING";
- case 0x1300 + 44: return "TCM_GETROWCOUNT";
- case 0x1300 + 45: return "TCM_GETTOOLTIPS";
- case 0x1300 + 46: return "TCM_SETTOOLTIPS";
- case 0x1300 + 47: return "TCM_GETCURFOCUS";
- case 0x1300 + 48: return "TCM_SETCURFOCUS";
- case 0x1300 + 49: return "TCM_SETMINTABWIDTH";
- case 0x1300 + 50: return "TCM_DESELECTALL";
-
- // toolbar
- case WM_USER+1: return "TB_ENABLEBUTTON";
- case WM_USER+2: return "TB_CHECKBUTTON";
- case WM_USER+3: return "TB_PRESSBUTTON";
- case WM_USER+4: return "TB_HIDEBUTTON";
- case WM_USER+5: return "TB_INDETERMINATE";
- case WM_USER+9: return "TB_ISBUTTONENABLED";
- case WM_USER+10: return "TB_ISBUTTONCHECKED";
- case WM_USER+11: return "TB_ISBUTTONPRESSED";
- case WM_USER+12: return "TB_ISBUTTONHIDDEN";
- case WM_USER+13: return "TB_ISBUTTONINDETERMINATE";
- case WM_USER+17: return "TB_SETSTATE";
- case WM_USER+18: return "TB_GETSTATE";
- case WM_USER+19: return "TB_ADDBITMAP";
- case WM_USER+20: return "TB_ADDBUTTONS";
- case WM_USER+21: return "TB_INSERTBUTTON";
- case WM_USER+22: return "TB_DELETEBUTTON";
- case WM_USER+23: return "TB_GETBUTTON";
- case WM_USER+24: return "TB_BUTTONCOUNT";
- case WM_USER+25: return "TB_COMMANDTOINDEX";
- case WM_USER+26: return "TB_SAVERESTOREA";
- case WM_USER+76: return "TB_SAVERESTOREW";
- case WM_USER+27: return "TB_CUSTOMIZE";
- case WM_USER+28: return "TB_ADDSTRINGA";
- case WM_USER+77: return "TB_ADDSTRINGW";
- case WM_USER+29: return "TB_GETITEMRECT";
- case WM_USER+30: return "TB_BUTTONSTRUCTSIZE";
- case WM_USER+31: return "TB_SETBUTTONSIZE";
- case WM_USER+32: return "TB_SETBITMAPSIZE";
- case WM_USER+33: return "TB_AUTOSIZE";
- case WM_USER+35: return "TB_GETTOOLTIPS";
- case WM_USER+36: return "TB_SETTOOLTIPS";
- case WM_USER+37: return "TB_SETPARENT";
- case WM_USER+39: return "TB_SETROWS";
- case WM_USER+40: return "TB_GETROWS";
- case WM_USER+42: return "TB_SETCMDID";
- case WM_USER+43: return "TB_CHANGEBITMAP";
- case WM_USER+44: return "TB_GETBITMAP";
- case WM_USER+45: return "TB_GETBUTTONTEXTA";
- case WM_USER+75: return "TB_GETBUTTONTEXTW";
- case WM_USER+46: return "TB_REPLACEBITMAP";
- case WM_USER+47: return "TB_SETINDENT";
- case WM_USER+48: return "TB_SETIMAGELIST";
- case WM_USER+49: return "TB_GETIMAGELIST";
- case WM_USER+50: return "TB_LOADIMAGES";
- case WM_USER+51: return "TB_GETRECT";
- case WM_USER+52: return "TB_SETHOTIMAGELIST";
- case WM_USER+53: return "TB_GETHOTIMAGELIST";
- case WM_USER+54: return "TB_SETDISABLEDIMAGELIST";
- case WM_USER+55: return "TB_GETDISABLEDIMAGELIST";
- case WM_USER+56: return "TB_SETSTYLE";
- case WM_USER+57: return "TB_GETSTYLE";
- case WM_USER+58: return "TB_GETBUTTONSIZE";
- case WM_USER+59: return "TB_SETBUTTONWIDTH";
- case WM_USER+60: return "TB_SETMAXTEXTROWS";
- case WM_USER+61: return "TB_GETTEXTROWS";
- case WM_USER+41: return "TB_GETBITMAPFLAGS";
+ // common controls messages - although they're not strictly speaking
+ // standard, it's nice to decode them nevertheless
+
+ // listview
+ case 0x1000 + 0: return "LVM_GETBKCOLOR";
+ case 0x1000 + 1: return "LVM_SETBKCOLOR";
+ case 0x1000 + 2: return "LVM_GETIMAGELIST";
+ case 0x1000 + 3: return "LVM_SETIMAGELIST";
+ case 0x1000 + 4: return "LVM_GETITEMCOUNT";
+ case 0x1000 + 5: return "LVM_GETITEMA";
+ case 0x1000 + 75: return "LVM_GETITEMW";
+ case 0x1000 + 6: return "LVM_SETITEMA";
+ case 0x1000 + 76: return "LVM_SETITEMW";
+ case 0x1000 + 7: return "LVM_INSERTITEMA";
+ case 0x1000 + 77: return "LVM_INSERTITEMW";
+ case 0x1000 + 8: return "LVM_DELETEITEM";
+ case 0x1000 + 9: return "LVM_DELETEALLITEMS";
+ case 0x1000 + 10: return "LVM_GETCALLBACKMASK";
+ case 0x1000 + 11: return "LVM_SETCALLBACKMASK";
+ case 0x1000 + 12: return "LVM_GETNEXTITEM";
+ case 0x1000 + 13: return "LVM_FINDITEMA";
+ case 0x1000 + 83: return "LVM_FINDITEMW";
+ case 0x1000 + 14: return "LVM_GETITEMRECT";
+ case 0x1000 + 15: return "LVM_SETITEMPOSITION";
+ case 0x1000 + 16: return "LVM_GETITEMPOSITION";
+ case 0x1000 + 17: return "LVM_GETSTRINGWIDTHA";
+ case 0x1000 + 87: return "LVM_GETSTRINGWIDTHW";
+ case 0x1000 + 18: return "LVM_HITTEST";
+ case 0x1000 + 19: return "LVM_ENSUREVISIBLE";
+ case 0x1000 + 20: return "LVM_SCROLL";
+ case 0x1000 + 21: return "LVM_REDRAWITEMS";
+ case 0x1000 + 22: return "LVM_ARRANGE";
+ case 0x1000 + 23: return "LVM_EDITLABELA";
+ case 0x1000 + 118: return "LVM_EDITLABELW";
+ case 0x1000 + 24: return "LVM_GETEDITCONTROL";
+ case 0x1000 + 25: return "LVM_GETCOLUMNA";
+ case 0x1000 + 95: return "LVM_GETCOLUMNW";
+ case 0x1000 + 26: return "LVM_SETCOLUMNA";
+ case 0x1000 + 96: return "LVM_SETCOLUMNW";
+ case 0x1000 + 27: return "LVM_INSERTCOLUMNA";
+ case 0x1000 + 97: return "LVM_INSERTCOLUMNW";
+ case 0x1000 + 28: return "LVM_DELETECOLUMN";
+ case 0x1000 + 29: return "LVM_GETCOLUMNWIDTH";
+ case 0x1000 + 30: return "LVM_SETCOLUMNWIDTH";
+ case 0x1000 + 31: return "LVM_GETHEADER";
+ case 0x1000 + 33: return "LVM_CREATEDRAGIMAGE";
+ case 0x1000 + 34: return "LVM_GETVIEWRECT";
+ case 0x1000 + 35: return "LVM_GETTEXTCOLOR";
+ case 0x1000 + 36: return "LVM_SETTEXTCOLOR";
+ case 0x1000 + 37: return "LVM_GETTEXTBKCOLOR";
+ case 0x1000 + 38: return "LVM_SETTEXTBKCOLOR";
+ case 0x1000 + 39: return "LVM_GETTOPINDEX";
+ case 0x1000 + 40: return "LVM_GETCOUNTPERPAGE";
+ case 0x1000 + 41: return "LVM_GETORIGIN";
+ case 0x1000 + 42: return "LVM_UPDATE";
+ case 0x1000 + 43: return "LVM_SETITEMSTATE";
+ case 0x1000 + 44: return "LVM_GETITEMSTATE";
+ case 0x1000 + 45: return "LVM_GETITEMTEXTA";
+ case 0x1000 + 115: return "LVM_GETITEMTEXTW";
+ case 0x1000 + 46: return "LVM_SETITEMTEXTA";
+ case 0x1000 + 116: return "LVM_SETITEMTEXTW";
+ case 0x1000 + 47: return "LVM_SETITEMCOUNT";
+ case 0x1000 + 48: return "LVM_SORTITEMS";
+ case 0x1000 + 49: return "LVM_SETITEMPOSITION32";
+ case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT";
+ case 0x1000 + 51: return "LVM_GETITEMSPACING";
+ case 0x1000 + 52: return "LVM_GETISEARCHSTRINGA";
+ case 0x1000 + 117: return "LVM_GETISEARCHSTRINGW";
+ case 0x1000 + 53: return "LVM_SETICONSPACING";
+ case 0x1000 + 54: return "LVM_SETEXTENDEDLISTVIEWSTYLE";
+ case 0x1000 + 55: return "LVM_GETEXTENDEDLISTVIEWSTYLE";
+ case 0x1000 + 56: return "LVM_GETSUBITEMRECT";
+ case 0x1000 + 57: return "LVM_SUBITEMHITTEST";
+ case 0x1000 + 58: return "LVM_SETCOLUMNORDERARRAY";
+ case 0x1000 + 59: return "LVM_GETCOLUMNORDERARRAY";
+ case 0x1000 + 60: return "LVM_SETHOTITEM";
+ case 0x1000 + 61: return "LVM_GETHOTITEM";
+ case 0x1000 + 62: return "LVM_SETHOTCURSOR";
+ case 0x1000 + 63: return "LVM_GETHOTCURSOR";
+ case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT";
+ case 0x1000 + 65: return "LVM_SETWORKAREA";
+
+ // tree view
+ case 0x1100 + 0: return "TVM_INSERTITEMA";
+ case 0x1100 + 50: return "TVM_INSERTITEMW";
+ case 0x1100 + 1: return "TVM_DELETEITEM";
+ case 0x1100 + 2: return "TVM_EXPAND";
+ case 0x1100 + 4: return "TVM_GETITEMRECT";
+ case 0x1100 + 5: return "TVM_GETCOUNT";
+ case 0x1100 + 6: return "TVM_GETINDENT";
+ case 0x1100 + 7: return "TVM_SETINDENT";
+ case 0x1100 + 8: return "TVM_GETIMAGELIST";
+ case 0x1100 + 9: return "TVM_SETIMAGELIST";
+ case 0x1100 + 10: return "TVM_GETNEXTITEM";
+ case 0x1100 + 11: return "TVM_SELECTITEM";
+ case 0x1100 + 12: return "TVM_GETITEMA";
+ case 0x1100 + 62: return "TVM_GETITEMW";
+ case 0x1100 + 13: return "TVM_SETITEMA";
+ case 0x1100 + 63: return "TVM_SETITEMW";
+ case 0x1100 + 14: return "TVM_EDITLABELA";
+ case 0x1100 + 65: return "TVM_EDITLABELW";
+ case 0x1100 + 15: return "TVM_GETEDITCONTROL";
+ case 0x1100 + 16: return "TVM_GETVISIBLECOUNT";
+ case 0x1100 + 17: return "TVM_HITTEST";
+ case 0x1100 + 18: return "TVM_CREATEDRAGIMAGE";
+ case 0x1100 + 19: return "TVM_SORTCHILDREN";
+ case 0x1100 + 20: return "TVM_ENSUREVISIBLE";
+ case 0x1100 + 21: return "TVM_SORTCHILDRENCB";
+ case 0x1100 + 22: return "TVM_ENDEDITLABELNOW";
+ case 0x1100 + 23: return "TVM_GETISEARCHSTRINGA";
+ case 0x1100 + 64: return "TVM_GETISEARCHSTRINGW";
+ case 0x1100 + 24: return "TVM_SETTOOLTIPS";
+ case 0x1100 + 25: return "TVM_GETTOOLTIPS";
+
+ // header
+ case 0x1200 + 0: return "HDM_GETITEMCOUNT";
+ case 0x1200 + 1: return "HDM_INSERTITEMA";
+ case 0x1200 + 10: return "HDM_INSERTITEMW";
+ case 0x1200 + 2: return "HDM_DELETEITEM";
+ case 0x1200 + 3: return "HDM_GETITEMA";
+ case 0x1200 + 11: return "HDM_GETITEMW";
+ case 0x1200 + 4: return "HDM_SETITEMA";
+ case 0x1200 + 12: return "HDM_SETITEMW";
+ case 0x1200 + 5: return "HDM_LAYOUT";
+ case 0x1200 + 6: return "HDM_HITTEST";
+ case 0x1200 + 7: return "HDM_GETITEMRECT";
+ case 0x1200 + 8: return "HDM_SETIMAGELIST";
+ case 0x1200 + 9: return "HDM_GETIMAGELIST";
+ case 0x1200 + 15: return "HDM_ORDERTOINDEX";
+ case 0x1200 + 16: return "HDM_CREATEDRAGIMAGE";
+ case 0x1200 + 17: return "HDM_GETORDERARRAY";
+ case 0x1200 + 18: return "HDM_SETORDERARRAY";
+ case 0x1200 + 19: return "HDM_SETHOTDIVIDER";
+
+ // tab control
+ case 0x1300 + 2: return "TCM_GETIMAGELIST";
+ case 0x1300 + 3: return "TCM_SETIMAGELIST";
+ case 0x1300 + 4: return "TCM_GETITEMCOUNT";
+ case 0x1300 + 5: return "TCM_GETITEMA";
+ case 0x1300 + 60: return "TCM_GETITEMW";
+ case 0x1300 + 6: return "TCM_SETITEMA";
+ case 0x1300 + 61: return "TCM_SETITEMW";
+ case 0x1300 + 7: return "TCM_INSERTITEMA";
+ case 0x1300 + 62: return "TCM_INSERTITEMW";
+ case 0x1300 + 8: return "TCM_DELETEITEM";
+ case 0x1300 + 9: return "TCM_DELETEALLITEMS";
+ case 0x1300 + 10: return "TCM_GETITEMRECT";
+ case 0x1300 + 11: return "TCM_GETCURSEL";
+ case 0x1300 + 12: return "TCM_SETCURSEL";
+ case 0x1300 + 13: return "TCM_HITTEST";
+ case 0x1300 + 14: return "TCM_SETITEMEXTRA";
+ case 0x1300 + 40: return "TCM_ADJUSTRECT";
+ case 0x1300 + 41: return "TCM_SETITEMSIZE";
+ case 0x1300 + 42: return "TCM_REMOVEIMAGE";
+ case 0x1300 + 43: return "TCM_SETPADDING";
+ case 0x1300 + 44: return "TCM_GETROWCOUNT";
+ case 0x1300 + 45: return "TCM_GETTOOLTIPS";
+ case 0x1300 + 46: return "TCM_SETTOOLTIPS";
+ case 0x1300 + 47: return "TCM_GETCURFOCUS";
+ case 0x1300 + 48: return "TCM_SETCURFOCUS";
+ case 0x1300 + 49: return "TCM_SETMINTABWIDTH";
+ case 0x1300 + 50: return "TCM_DESELECTALL";
+
+ // toolbar
+ case WM_USER+1: return "TB_ENABLEBUTTON";
+ case WM_USER+2: return "TB_CHECKBUTTON";
+ case WM_USER+3: return "TB_PRESSBUTTON";
+ case WM_USER+4: return "TB_HIDEBUTTON";
+ case WM_USER+5: return "TB_INDETERMINATE";
+ case WM_USER+9: return "TB_ISBUTTONENABLED";
+ case WM_USER+10: return "TB_ISBUTTONCHECKED";
+ case WM_USER+11: return "TB_ISBUTTONPRESSED";
+ case WM_USER+12: return "TB_ISBUTTONHIDDEN";
+ case WM_USER+13: return "TB_ISBUTTONINDETERMINATE";
+ case WM_USER+17: return "TB_SETSTATE";
+ case WM_USER+18: return "TB_GETSTATE";
+ case WM_USER+19: return "TB_ADDBITMAP";
+ case WM_USER+20: return "TB_ADDBUTTONS";
+ case WM_USER+21: return "TB_INSERTBUTTON";
+ case WM_USER+22: return "TB_DELETEBUTTON";
+ case WM_USER+23: return "TB_GETBUTTON";
+ case WM_USER+24: return "TB_BUTTONCOUNT";
+ case WM_USER+25: return "TB_COMMANDTOINDEX";
+ case WM_USER+26: return "TB_SAVERESTOREA";
+ case WM_USER+76: return "TB_SAVERESTOREW";
+ case WM_USER+27: return "TB_CUSTOMIZE";
+ case WM_USER+28: return "TB_ADDSTRINGA";
+ case WM_USER+77: return "TB_ADDSTRINGW";
+ case WM_USER+29: return "TB_GETITEMRECT";
+ case WM_USER+30: return "TB_BUTTONSTRUCTSIZE";
+ case WM_USER+31: return "TB_SETBUTTONSIZE";
+ case WM_USER+32: return "TB_SETBITMAPSIZE";
+ case WM_USER+33: return "TB_AUTOSIZE";
+ case WM_USER+35: return "TB_GETTOOLTIPS";
+ case WM_USER+36: return "TB_SETTOOLTIPS";
+ case WM_USER+37: return "TB_SETPARENT";
+ case WM_USER+39: return "TB_SETROWS";
+ case WM_USER+40: return "TB_GETROWS";
+ case WM_USER+42: return "TB_SETCMDID";
+ case WM_USER+43: return "TB_CHANGEBITMAP";
+ case WM_USER+44: return "TB_GETBITMAP";
+ case WM_USER+45: return "TB_GETBUTTONTEXTA";
+ case WM_USER+75: return "TB_GETBUTTONTEXTW";
+ case WM_USER+46: return "TB_REPLACEBITMAP";
+ case WM_USER+47: return "TB_SETINDENT";
+ case WM_USER+48: return "TB_SETIMAGELIST";
+ case WM_USER+49: return "TB_GETIMAGELIST";
+ case WM_USER+50: return "TB_LOADIMAGES";
+ case WM_USER+51: return "TB_GETRECT";
+ case WM_USER+52: return "TB_SETHOTIMAGELIST";
+ case WM_USER+53: return "TB_GETHOTIMAGELIST";
+ case WM_USER+54: return "TB_SETDISABLEDIMAGELIST";
+ case WM_USER+55: return "TB_GETDISABLEDIMAGELIST";
+ case WM_USER+56: return "TB_SETSTYLE";
+ case WM_USER+57: return "TB_GETSTYLE";
+ case WM_USER+58: return "TB_GETBUTTONSIZE";
+ case WM_USER+59: return "TB_SETBUTTONWIDTH";
+ case WM_USER+60: return "TB_SETMAXTEXTROWS";
+ case WM_USER+61: return "TB_GETTEXTROWS";
+ case WM_USER+41: return "TB_GETBITMAPFLAGS";