{"issue":{"state":"open","created_at":"2011-09-29T08:44:30Z","updated_at":"2011-12-15T14:01:19Z","user":{"gravatar_id":"c05b9d250759968871a3194cf0816e8f","id":513286,"url":"https://api.github.com/users/blackoise","avatar_url":"https://secure.gravatar.com/avatar/c05b9d250759968871a3194cf0816e8f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"blackoise"},"comments":1,"body":"Some users still have problems with non attaching putty windows.\r\nIt seems that the timing for the additional timing.\r\nBest thing to do at this moment is to make the amount of time configurable.","assignee":null,"id":1772943,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":25,"title":"Configurable additional timing","html_url":"https://github.com/phendryx/superputty/issues/25","closed_at":null,"milestone":null,"url":"https://api.github.com/repos/phendryx/superputty/issues/25"},"action":"created","comment":{"created_at":"2011-12-15T14:01:19Z","updated_at":"2011-12-15T14:01:19Z","user":{"gravatar_id":"19174a24d3a31a8bd4c031e6162a38a8","id":1265512,"url":"https://api.github.com/users/SkyBeam","avatar_url":"https://secure.gravatar.com/avatar/19174a24d3a31a8bd4c031e6162a38a8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"SkyBeam"},"body":"Hi,\r\n\r\nActually I had a look at the code and did some research. It seems to me that the MainWindowHandle property sometimes returns 0 even if WaitForInputIdle() is called before. So I have inserted some code to work-around this (ctlApplicationPanel.cs, Line 1219ff):\r\n\r\n                    // Additional timing\r\n                    if(Classes.Database.GetBooleanKey(\"additional_timing\", false))\r\n                    {\r\n                     System.Threading.Thread.Sleep(200);\r\n                    }\r\n\r\n                    for (int i = 0; i < 500; i++)\r\n                    {\r\n                        if (m_Process.MainWindowHandle != IntPtr.Zero)\r\n                        {\r\n                            break;\r\n                        }\r\n                        System.Threading.Thread.Sleep(20);\r\n                        m_Process.Refresh();\r\n                    }\r\n\r\n                    m_AppWin = m_Process.MainWindowHandle;\r\n\r\n\r\nThis additional for-loop basically works for me with PuTTY 0.60, 0.61 and 0.62. So this makes me believe it even works for future versions.\r\n\r\nI have even removed the \"additional timing\" part as it seems not to be required any more.\r\n\r\nMaybe this code can be reviewed and included in a future release. ","id":3161262,"url":"https://api.github.com/repos/phendryx/superputty/issues/comments/3161262"}}