"I really love Ext but coding in javascript just gives me the chills. So I went out and found a way to use my favorite js library (Ext) and my favorite programming language (C#) at the same time. By using a project called Script# I am able to write C# code and have it converted into javascript, similar to GWT. Building on that, Script# also allows you to code against external APIs, but you need to create the types, methods, properties, etc. for everything in the javascript library. So what I did was write a little console app that parses all of the ExtJS source files extracting out the script comments and writing C# files for each class. The end result is a programmable C# API to access all of the Ext objects and I threw in a couple new things to make life a little easier."
Showing posts with label C# Code. Show all posts
Showing posts with label C# Code. Show all posts
Thursday, April 10, 2008
ExtJS with C#
http://code.google.com/p/extsharp/

"I really love Ext but coding in javascript just gives me the chills. So I went out and found a way to use my favorite js library (Ext) and my favorite programming language (C#) at the same time. By using a project called Script# I am able to write C# code and have it converted into javascript, similar to GWT. Building on that, Script# also allows you to code against external APIs, but you need to create the types, methods, properties, etc. for everything in the javascript library. So what I did was write a little console app that parses all of the ExtJS source files extracting out the script comments and writing C# files for each class. The end result is a programmable C# API to access all of the Ext objects and I threw in a couple new things to make life a little easier."
"I really love Ext but coding in javascript just gives me the chills. So I went out and found a way to use my favorite js library (Ext) and my favorite programming language (C#) at the same time. By using a project called Script# I am able to write C# code and have it converted into javascript, similar to GWT. Building on that, Script# also allows you to code against external APIs, but you need to create the types, methods, properties, etc. for everything in the javascript library. So what I did was write a little console app that parses all of the ExtJS source files extracting out the script comments and writing C# files for each class. The end result is a programmable C# API to access all of the Ext objects and I threw in a couple new things to make life a little easier."
Thursday, February 21, 2008
Handle Active Tab and Screen Capture in IE6 & IE7
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
IntPtr activeWindowHandle;
mshtml.IHTMLDocument2 myDoc;
mshtml.IHTMLDocument3 myDoc1;
activeWindowHandle = GetForegroundWindow();
IntPtr myIntptr = activeWindowHandle;
int hwndInt = myIntptr.ToInt32();
IntPtr hwnd = myIntptr;
IntPtr hwnd1 = IntPtr.Zero;
hwnd = GetWindow(hwnd, GW_CHILD);
StringBuilder sbc = new StringBuilder(256);
IEnumerator windows = new SHDocVw.ShellWindowsClass().GetEnumerator();
while (windows.MoveNext())
{
if ((windows.Current is SHDocVw.IWebBrowser2) && ((windows.Current as SHDocVw.IWebBrowser2).HWND.ToString() == activeWindowHandle.ToString()))
{
((windows.Current as SHDocVw.IWebBrowser2).Document as IOleWindow).GetWindow(out hwnd);
if (IsWindowVisible(hwnd))
{
break;
}
}
}
myDoc = ((windows.Current as SHDocVw.IWebBrowser2).Document as mshtml.IHTMLDocument2);
myDoc1 = ((windows.Current as SHDocVw.IWebBrowser2).Document as mshtml.IHTMLDocument3);
IntPtr activeWindowHandle;
mshtml.IHTMLDocument2 myDoc;
mshtml.IHTMLDocument3 myDoc1;
activeWindowHandle = GetForegroundWindow();
IntPtr myIntptr = activeWindowHandle;
int hwndInt = myIntptr.ToInt32();
IntPtr hwnd = myIntptr;
IntPtr hwnd1 = IntPtr.Zero;
hwnd = GetWindow(hwnd, GW_CHILD);
StringBuilder sbc = new StringBuilder(256);
IEnumerator windows = new SHDocVw.ShellWindowsClass().GetEnumerator();
while (windows.MoveNext())
{
if ((windows.Current is SHDocVw.IWebBrowser2) && ((windows.Current as SHDocVw.IWebBrowser2).HWND.ToString() == activeWindowHandle.ToString()))
{
((windows.Current as SHDocVw.IWebBrowser2).Document as IOleWindow).GetWindow(out hwnd);
if (IsWindowVisible(hwnd))
{
break;
}
}
}
myDoc = ((windows.Current as SHDocVw.IWebBrowser2).Document as mshtml.IHTMLDocument2);
myDoc1 = ((windows.Current as SHDocVw.IWebBrowser2).Document as mshtml.IHTMLDocument3);
Find Actice TAB in IE7
if (sbc.ToString().IndexOf("TabWindowClass", 0) > -1)
{
StringBuilder childsb = new StringBuilder(100);
IntPtr hChildWnd = GetWindow(hwnd, GW_CHILD);
while (IntPtr.Zero != hChildWnd)
{
GetClassName(hChildWnd.ToInt32(), childsb, 100);
if (childsb.ToString().Contains("Shell DocObject View"))
{
IntPtr visWin = FindWindowEx(hChildWnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
if (IsWindowVisible(visWin))
{
hwnd = visWin;
break ;
}
}
hChildWnd = GetWindow(hChildWnd, GW_HWNDNEXT);
}
{
StringBuilder childsb = new StringBuilder(100);
IntPtr hChildWnd = GetWindow(hwnd, GW_CHILD);
while (IntPtr.Zero != hChildWnd)
{
GetClassName(hChildWnd.ToInt32(), childsb, 100);
if (childsb.ToString().Contains("Shell DocObject View"))
{
IntPtr visWin = FindWindowEx(hChildWnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
if (IsWindowVisible(visWin))
{
hwnd = visWin;
break ;
}
}
hChildWnd = GetWindow(hChildWnd, GW_HWNDNEXT);
}
Subscribe to:
Posts (Atom)