C# [WinForm] WS_TABSTOP 無效的解決辦法

關鍵:

IsDialogMessage function

                    MSG msg;
                    int bRet = 1;
                    while (bRet != 0)
                    {
                        if (PeekMessageW(&msg, (IntPtr)0, 0u, 0u, 0u) != 0)
                        {
                            if ((bRet = GetMessageW(&msg, (IntPtr)0, 0u, 0u)) != 0)
                            {
                                if (bRet == -1)
                                {
                                    // handle the error and possibly exit
                                }
                                else
                                {
                                    IntPtr h = GetAncestor(msg.hwnd, GA_ROOT);
                                    if (IsDialogMessageW(h, &msg) == 0 &&
                                        TranslateAcceleratorW(h, (IntPtr)0, &msg) == 0)
                                    {
                                        TranslateMessage(&msg);
                                        DispatchMessageW(&msg);
                                    }
                                }
                            }
                        }
                        else
                        {
                            WaitMessage();
                        }
                    }

  

猜你喜欢

转载自www.cnblogs.com/shitekudasai/p/9545536.html