简体   繁体   中英

Embed a 3rd party AIR program inside a c# form

I was looking for a way to embed a AIR standalone - singleform air program inside a visual c# form.

I don't need to have any communication with it whatsoever, I just need to have it "stuck" in a zone of my form so it moves around with me and it resizes when i do. (ie: my form needs to control its handler, right?)

I tried using the SetParent from the user32.dll lib, but it doesn't work with it (although it works with notepad.exe, so the code is correct).

repeat: i don't want to have interactivity, i just want it there "as a widget".

Thank you.

UPDATE: I know this sounds strange, But the AIR application in question is an actual .exe file, not a swf. (In fact, this is puzzling for me, but I'm quite sure it is like that for it says that you need to install air when you install it the first time), i'm talking about this app: http://assistenza.vodafone.it/privati/servizi_web/applicazioni/widget_vodafone_it

UPDATE 2: I tried using the user32.dll SetParent function but i receive a 1400 error: INVALID_WINDOW_HANDLER, although the handler is retrieved by calling process.MainWindowsHandle, and i repeat, this code works for notepad:

        Process notePad = Process.Start("C:\\Windows\\System32\\notepad.exe");
        notePad.WaitForInputIdle();
        this.appNotePad = notePad.MainWindowHandle;
        SetWindowPos(this.appNotePad, -1, 0, 0, panelNotepad.Size.Width, panelNotepad.Height, SWP_NOMOVE);
        SetParent(this.appNotePad, panelNotepad.Handle);
        SetWindowLong(this.appNotePad, GWL_STYLE, WS_VISIBLE);

Maybe using the WebBrowserObject could be a solution. This is embedding an Internet Explorer inside a form, so, you can set an html page as default one for it and show your Adobe AIR application.

I'll check if there's another way of doing that, but this is acceptable if you don't need to communicate your forms application with the AIR one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM