开发者

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.

  • http://msdn.microsoft.com/en-us/library/aa752085(v=vs.85).aspx

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜