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

2021-07-14 06:14

阅读:616

标签:for   form   exit   desktop   arp   possibly   roo   https   target   

關鍵:

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();
                        }
                    }

  

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

标签:for   form   exit   desktop   arp   possibly   roo   https   target   

原文地址:https://www.cnblogs.com/shitekudasai/p/9545536.html


评论


亲,登录后才可以留言!