vivek
2012-02-14 06:24:35 UTC
Hi,
I am working on windows form application using c#.
I need to set parent a thick client application inside a tab
control(tab page)
The code to set parent is
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr
hWndNewParent);
SetParent(<thick client application handle>, tabpage handle)
and then am using setwindowpos function to set its position in tab
page
SetWindowPos((int)<thick client application handle>, 0, 0, 0,
this.Width, 0, (uint)SWP_NOZORDER | (uint)SWP_NOSIZE |
(uint)SWP_SHOWWINDOW);
This code works fine in win xp. But for some Win 7 machines after
doing setparent and setpos , the menus and the buttons on that thick
client doesn't work. i.e. they does not response to mouse clicks.
Although the keystrokes works i.e. if i do a tab and press enter
buttons will respond. What is wrong with my code?
Please provide your inputs on the same.
Thanks
Vivek
I am working on windows form application using c#.
I need to set parent a thick client application inside a tab
control(tab page)
The code to set parent is
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr
hWndNewParent);
SetParent(<thick client application handle>, tabpage handle)
and then am using setwindowpos function to set its position in tab
page
SetWindowPos((int)<thick client application handle>, 0, 0, 0,
this.Width, 0, (uint)SWP_NOZORDER | (uint)SWP_NOSIZE |
(uint)SWP_SHOWWINDOW);
This code works fine in win xp. But for some Win 7 machines after
doing setparent and setpos , the menus and the buttons on that thick
client doesn't work. i.e. they does not response to mouse clicks.
Although the keystrokes works i.e. if i do a tab and press enter
buttons will respond. What is wrong with my code?
Please provide your inputs on the same.
Thanks
Vivek