Re: Delegate.BeginInvoke and EndInvoke.
"Bhatnagar, Amit" <[email protected]> Wed, 16 Jan 2008 15:46:04 -0700
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
I think I incorrectly passed in the wrong param for uiParam. I am passing in .cbSize and the example on Pinvoke.net has it being 0.. (although I could have sworn that pinvoke.net is where I originally got my sample from!).. could this cause the hang? -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Bhatnagar, Amit Sent: Wednesday, January 16, 2008 3:29 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Delegate.BeginInvoke and EndInvoke. Here is the relevant code snippets, like I said, this works most of the time, but sometimes it hangs. // The SPI_GETNONCLIENTMETRICS call only gets called once at initialization, // setting the touch screen size and hanging on to them.=20 m_standardNonClientMetrics =3D new NONCLIENTMETRICS(); m_standardNonClientMetrics.cbSize =3D=20 Marshal.SizeOf(typeof(NONCLIENTMETRICS)); bool result =3D SystemParametersInfo(SPI_GETNONCLIENTMETRICS,=20 =20 m_standardNonClientMetrics.cbSize,=20 ref m_standardNonClientMetrics,=20 0); =20 m_standardNonClientMetrics.scrollHeight =3D SCROLLBAR_HEIGHT; m_standardNonClientMetrics.scrollWidth =3D SCROLLBAR_WIDTH; m_touchScreenNonClientMetrics =3D new NONCLIENTMETRICS(); m_touchScreenNonClientMetrics =3D m_standardNonClientMetrics; m_touchScreenNonClientMetrics.scrollWidth =3D TS_SCROLLBAR_WIDTH; m_touchScreenNonClientMetrics.scrollHeight =3D TS_SCROLLBAR_HEIGHT; // Increase the size of the scrollbars here. result =3D=20 SystemParametersInfo(SPI_SETNONCLIENTMETRICS,=20 =20 m_touchScreenNonClientMetrics.cbSize,=20 ref m_touchScreenNonClientMetrics,=20 0); =20 -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Peter Ritchie Sent: Wednesday, January 16, 2008 3:08 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Delegate.BeginInvoke and EndInvoke. On Wed, 16 Jan 2008 10:12:22 +0100, Fabian Schmied <[email protected]> wrote: >(As a side note, I don't really know much about SystemParametersInfo,=20 >but maybe you should ask at a Win32 forum as well - somebody might have >had this issue before. There's also this posting by Raymond Chen: >http://blogs.msdn.com/oldnewthing/archive/2005/03/10/392118.aspx - he=20 >also talks about the WM_SETTINGCHANGE message; but it doesn't have to=20 >be your own window that is blocking, it might be a different one.) Amit mentioned that he wasn't using the flag that causes the send of WM_SETTINGCHANGE; so I can see no reason why it would hang... Seeing the code might be useful... The information contained in this e-mail message is PRIVATE. It may contain confidential information and may be legally privileged. It is intended for the exclusive use of the addressee(s). If you are not the intended recipient, you are hereby notified that any dissemination, distribution or reproduction of this communication is strictly prohibited. If the intended recipient(s) cannot be reached or if a transmission problem has occurred, please notify the sender immediately by return e-mail and destroy all copies of this message.=20 Thank you.=20