Discussion:
Setparent and SetPos : Buttons/menus not accessible
(too old to reply)
vivek
2012-02-14 06:24:35 UTC
Permalink
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
p***@gmail.com
2012-11-11 06:04:09 UTC
Permalink
Post by vivek
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
Do you resolve?? help me please, i have same problem
t***@gmail.com
2016-02-17 09:25:21 UTC
Permalink
Have you solve the above problem??I am facing same...

Loading...