<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 06.01.2012, at 19:43, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Fri, Jan 6, 2012 at 8:13 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">
<div class="im"><br>
On 06.01.2012, at 16:55, John McKeon wrote:<br>
<br>
&gt; I thought I would help out and test it on Windows.<br>
&gt; For some reason the mouse events from the HostWindow never reflect the button press. evt at: 5 always returns 0.<br>
<br>
</div>That's strange. HostWindowPlugin uses the same code to record mouse events as the regular window ...<br>
<div class="im"><br>
&gt; One other thing I noticed is the main Squeak window title changes to "Paint Test" and the host window title is "Squeak!".<br>
&gt; Tested on Win7 and XP with the cog vm v2522 13 Dec 2011<br>
<br>
</div>Hehe. Okay, that one is obviously a bug in the VM. It should really use SetWindowTextW(hwnd, ...:<br>
<br>
sqInt ioSetTitleOfWindow(sqInt windowIndex, char * newTitle, sqInt sizeOfTitle) {<br>
 &nbsp;HWND hwnd = (windowIndex == 1 ? stWindow : ((HWND)windowIndex));<br>
 &nbsp;char titleString[1024];<br>
 &nbsp;WCHAR wideTitle[1024];<br>
<br>
 &nbsp;if(!IsWindow(hwnd)) return 0;<br>
 &nbsp;if (sizeOfTitle &gt; 1023) sizeOfTitle = 1023;<br>
 &nbsp;strncpy(titleString, newTitle, sizeOfTitle);<br>
 &nbsp;titleString[sizeOfTitle] = 0;<br>
 &nbsp;MultiByteToWideChar(CP_UTF8, 0, titleString, -1, wideTitle, 1024);<br>
 &nbsp;if(SetWindowTextW(stWindow, wideTitle) == 0) return -1;<br>
 &nbsp;return sizeOfTitle;<br>
}<br></blockquote><div><br></div><div>But the code in platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c in the Cog sources looks to be exactly that, and the code hasn't changed since April 2010... &nbsp;Which version of the sources contains the bug?</div>
</div></blockquote><br></div><div>That version. It needs to say this instead:</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">SetWindowTextW(hwnd, ...</blockquote></div><div><br></div><div>It should use hwnd instead of stWindow.</div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div></span></div><br></body></html>