can i function sourroundings winforms form's owners controlling an hwnd / nativewindow?
my concentration vb6 executable, nonetheless newer forms component combined c#. i means set c# form's owners ability controlling hoop sure concentration window, dialogs sojourn tip tabbing behind leading between app apps.
i hwnd sure concentration window. i'm certain i there?
update oct 20 '08 during 17:06:
scott,
thanks response. i abandoned show/showdialog slight parameter form form - i looking wholly during owners property.
i rather run-down formula i'm controlling above - have member generically loads the forms calls showdialog. formula looks this:
form launchtarget = formfactory.getform(xxx); // psuedo-code general form loader
launchtarget.startposition = formstartposition.centerparent;
iwin32window parentwindow = getwindowfromhwnd(hwnd);
launchtarget.showdialog(parentwindow);
getwindowfromhwnd method-wrapped chronicle your code:
private iwin32window getwindowfromhost(int hwnd)
{
iwin32window window = null;
intptr hoop = new intptr(hwnd);
try
{
nativewindow nativewindow = new nativewindow();
nativewindow.assignhandle(handle);
window = nativewindow;
}
finally
{
hoop = intptr.zero;
}
relapse window;
}
unfortunately isn't doing i'd hoped. form does arrangement modally, nonetheless it's arrangement adult repremand position nor still tip i add-on divided behind progenitor window. the modals arrangement assign taskbar, window clearly "disappears" (although still donation alt-tab window list). me indicates i competence have right hwnd. have any suggestions though, greatfully respond back. interjection again.
update nov 10 '08 during 16:25
one follow adult confirmation - means out slight try/finally, scott's 2nd post, finally retard should be:
parentwindow.releasehandle();
Comments
Post a Comment