dcoder wrote:Softanics wrote:Do you call fib_form.winproc from inherited_form.winproc ?
I see it is not working though inherited and overriden.. let me give you piece of code in here..
class CustomizedForm : f_in_box_form {
// other stuff
protected override void WndProc(ref Message msg)
{
// Some windows message handling
base.WndProc(ref msg);
}
}
// Child Form
public partial class PreviewWindow : CustomizedForm
{
ContextMenu cm = new ContextMenu();
public PreviewWindow()
{
MenuItem tsi = new MenuItem("About Preview Window...", new EventHandler(About_Click));
cm.MenuItems.Add(tsi);
tsi = new MenuItem("-");
cm.MenuItems.Add(tsi);
tsi = new MenuItem("Reload", new EventHandler(Reload_Click));
cm.MenuItems.Add(tsi);
tsi = new MenuItem("Close", new EventHandler(Close_Click));
cm.MenuItems.Add(tsi);
ContextMenu = cm;
FlashProperty_Scale = "ShowAll";
FlashProperty_Movie = @"E:\Development\Home\ABC\ABC\PreviewWindow.swf";
InitializeComponent();
Height = 100;
ShowInTaskbar = false;
OnFlashCall += new OnFlashCallEventHandler(PreviewWindow_OnFlashCall);
FlashMethod_SetVariable("test", "some test from c#");
}
// overriden WndProc after your post but still does not work.
protected override void WndProc(ref Message msg)
{
base.WndProc(ref msg);
}
void PreviewWindow_OnFlashCall(object sender, string request)
{
try
{
FlashMethod_SetReturnValue(GetContent());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private string GetContent() {
List<string> strList = new List<string> ();
strList.Add("some text one");
strList.Add("some text two");
strList.Add("some text three");
string array = "<array>";
int id = 0;
foreach (string str in strList) {
array += "<property id='" + id + "'><string>" + str + "</string></property>";
id++;
}
array += "</array>";
return array;
}
void Close_Click(object sender, EventArgs e)
{
Close();
}
void About_Click(object sender, EventArgs e)
{
MessageBox.Show("Designed and developed by myself");
}
void Reload_Click(object sender, EventArgs e)
{
ReloadContent()
}
private void ReloadContent()
{
FlashMethod_SetReturnValue(GetContent());
}
}
Artim, i would like to you do the same and include some test winproc code in your form and inherit it from fib_form and then inherit this form to another form where you put flash movie and test it.
i hope you would have gotten the idea where the problem actually is or i might be doing soemthing wrong which is preventing me from doing what i want to.
regards,