Thursday, February 21, 2008

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);
}

Get inner browser window in IE6 and IE7

int hwndInt = myIntptr.ToInt32();
IntPtr hwnd = myIntptr;
while (hwndInt != 0)
{
hwndInt = hwnd.ToInt32();
GetClassName(hwndInt, sbc, 256);

if (sbc.ToString().IndexOf("TabWindowClass", 0) > -1)
{
hwnd = FindWindowEx(hwnd, IntPtr.Zero, "Shell DocObject View", IntPtr.Zero);
hwnd = FindWindowEx(hwnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
break;
}

else if (sbc.ToString().IndexOf("Shell DocObject View", 0) > -1)
{
hwnd = FindWindowEx(hwnd, IntPtr.Zero, "Internet Explorer_Server", IntPtr.Zero);
break;
}
hwnd = GetWindow(hwnd, GW_HWNDNEXT);
}

Wednesday, February 20, 2008

AMR to mp3

Here is a code that you can use to convert AMR file to various other files:

Pre-requisites

Emerge sox, Vorbis-tools and lame. Build the the 3GPP reference converter files (compiled with these changes: make file without -DETSI and add #include "sp_dec.h" to decoder.c).

Convert AMR to OGG Vorbis

File: /usr/local/bin/amrtoogg

#!/bin/bash
 
# By Aquarion - Aquarion@Aquarionics.com
# Do what you want with it, it's not rocket science.
 
##Change these:
#Wherever you put encode and decode when you compiled them:
CODEC=/usr/local/bin
 
#Temporary directory. Chances are you've already got this set
TEMP=/tmp
 
#Where do the final MP3s go?
FINAL=/home/user/media/siemens/ogg
 
for file in *.amr; do 
        FILE=`echo $file | sed -e "s/.amr//"`; 
        echo -n "$FILE [AMR] -> [RAW]"
        $CODEC/decoder $file $TEMP/$FILE.raw > log.std 2> log.err; 
        echo -n " -> [WAV] "
        sox -r 8000 -w -c 1 -s $TEMP/$FILE.raw -r 44100 \
               -w -c 1 $TEMP/$FILE.wav > log.std 2> log.err; 
        echo -n " -> [OGG] "
        oggenc $TEMP/$FILE.wav -q 5 -o $FINAL/$FILE.ogg --quiet \
               -t "$FILE" -a "Sanda" -l "Anul nou" -d `date +%Y`
        echo  " :-) "
        rm $TEMP/$FILE.wav;
        rm $TEMP/$FILE.raw;
done

Convert AMR to MP3

File: /usr/local/bin/amrtomp3

#!/bin/bash
 
# By Aquarion - Aquarion@Aquarionics.com
# Do what you want with it, it's not rocket science.
 
##Change these:
#Wherever you put encode and decode when you compiled them:
CODEC=/usr/local/bin
 
#Temporary directory. Chances are you've already got this set
TEMP=/tmp
 
#Where do the final MP3s go?
FINAL=/home/user/media/siemens/mp3
 
for file in *.amr; do 
        FILE=`echo $file | sed -e "s/.amr//"`; 
        echo -n "$FILE [AMR] -> [RAW]"
        $CODEC/decoder $file $TEMP/$FILE.raw > log.std 2> log.err; 
        echo -n " -> [WAV] "
        sox -r 8000 -w -c 1 -s $TEMP/$FILE.raw -r 44100 \
               -w -c 1 $TEMP/$FILE.wav > log.std 2> log.err; 
        echo -n " -> [MP3] "
        lame $TEMP/$FILE.wav $FINAL/$FILE.mp3 --preset standard --silent \
               --tt $FILE --ta Sanda --tl Anul\ Nou --ty `date +%Y`
        echo  " :-) "
        rm $TEMP/$FILE.wav;
        rm $TEMP/$FILE.raw;
done

Tuesday, February 19, 2008

Microsoft DreamSpark - Get free microsoft softwares

"DreamSpark is simple, it's all about giving students Microsoft professional-level developer and design tools at no charge so you can chase your dreams and create the next big breakthrough in technology - or just get a head start on your career. "

But it doesn't work for India at all. Only China is listed in Asia.

Microsoft DreamSpark

Free Good Icons



PNG Icons & Icon Packs Download | IconsPedia

Step by Step example - All manual

"You might have encountered interactive demos created with screencasting and screengrabbing software that explain an interface to users in a step-by-step manner. This is exactly what this script does for web sites.

When you loaded this page and all went well you'll have seen the examples, download and first paragraph section being highlighted and a small panel with information showing up in succession. This is done with this script."


Step by Step uses the Yahoo User Interface library, and pulls in most of its dependencies automatically


Step by Step example - All manual

Images to index in search engines

Graphic and flash images are no doubt attractive to the eye, and are pleasing to look But did you know that search engines do not index them at all?

Here’s a method you can use to get all of your images and artwork indexed by the search engines:

Just make sure you include the “alt” tag in your img src tags. It’s as simple and helpful ! !!!