getwindowlong

GetWindowLong vs GetWindowLongPtr in C#

余生长醉 提交于 2019-12-10 20:25:44
问题 I was using GetWindowLong like this: [DllImport("user32.dll")] private static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex); But according to the MSDN docs I am supposed to be using GetWindowLongPtr to be 64bit compatible. http://msdn.microsoft.com/en-us/library/ms633584(VS.85).aspx The MSDN docs for GetWindowLongPtr say that I should define it like this (in C++): LONG_PTR GetWindowLongPtr(HWND hWnd, int nIndex); I used to be using IntPtr as the return type, but what the heck would I

Removing window border?

我与影子孤独终老i 提交于 2019-11-27 03:03:55
I have a window with a solid border around it. How can I remove the border (all of the non-client area) by using SetWindowLong and GetWindowLong ? John Knoeller In C/C++ LONG lStyle = GetWindowLong(hwnd, GWL_STYLE); lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU); SetWindowLong(hwnd, GWL_STYLE, lStyle); WS_CAPTION is defined as (WS_BORDER | WS_DLGFRAME). You can get away with removing just these two styles, since the minimize maximize and sytem menu will disappear when the caption disappears, but it's best to remove them as well. It's also best to remove

How do I pinvoke to GetWindowLongPtr and SetWindowLongPtr on 32-bit platforms?

天大地大妈咪最大 提交于 2019-11-26 20:56:57
I want to P/Invoke to GetWindowLongPtr and SetWindowLongPtr , and I'm seeing conflicting information about them. Some sources say that, on 32-bit platforms, GetWindowLongPtr is just a preprocessor macro that calls GetWindowLong, and GetWindowLongPtr doesn't exist as an entry point in user32.dll. For example: The pinvoke.net entry for SetWindowLongPtr has a static method that checks IntPtr.Size and then calls either SetWindowLong or SetWindowLongPtr, with a comment saying that "legacy OSes do not support SetWindowLongPtr". There's no explanation of what is meant by "legacy OSes". An answer on

Removing window border?

怎甘沉沦 提交于 2019-11-26 10:22:49
问题 I have a window with a solid border around it. How can I remove the border (all of the non-client area) by using SetWindowLong and GetWindowLong ? 回答1: In C/C++ LONG lStyle = GetWindowLong(hwnd, GWL_STYLE); lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU); SetWindowLong(hwnd, GWL_STYLE, lStyle); WS_CAPTION is defined as (WS_BORDER | WS_DLGFRAME). You can get away with removing just these two styles, since the minimize maximize and sytem menu will

How do I pinvoke to GetWindowLongPtr and SetWindowLongPtr on 32-bit platforms?

最后都变了- 提交于 2019-11-26 06:47:49
问题 I want to P/Invoke to GetWindowLongPtr and SetWindowLongPtr, and I\'m seeing conflicting information about them. Some sources say that, on 32-bit platforms, GetWindowLongPtr is just a preprocessor macro that calls GetWindowLong, and GetWindowLongPtr doesn\'t exist as an entry point in user32.dll. For example: The pinvoke.net entry for SetWindowLongPtr has a static method that checks IntPtr.Size and then calls either SetWindowLong or SetWindowLongPtr, with a comment saying that \"legacy OSes