Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setparent and SetPos : Buttons/menus not accessible

93 views
Skip to first unread message

vivek

unread,
Feb 14, 2012, 1:24:35 AM2/14/12
to
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

paulo....@gmail.com

unread,
Nov 11, 2012, 1:04:09 AM11/11/12
to
Do you resolve?? help me please, i have same problem

troh...@gmail.com

unread,
Feb 17, 2016, 4:25:24 AM2/17/16
to
Have you solve the above problem??I am facing same...
0 new messages