trap CTRL-C problem

I am trying to trap CTRL-C, now the program I call has it's own exit message, I think this is the problem ..

This is what I have now :

function dothis
{
echo 'you hit control-c'
exit
}

function settrap
{
trap dothis SIGINT
}
settrap
until false; do
./ITGRecv.exe
done

Doing this I am able to trap it but only after pressing CTRL-C twice, the first time I press it it just runs my program again.
Could also be because of the until statement that runs it one last time ..
Already changed it, originaly was WHILE TRUE.

I don't know, any help is appreciated ..

Lose the functions.

trap 'echo "you hit control-c"; exit'  INT

Using some posix-sh:

#!/bin/somesh

dothis()
{
   echo "you hit control-c"
   exit
}

settrap()
{
   trap 'dothis' INT
}

###########
settrap
while :
do
   echo "PID:$$"
   date
   sleep 10
done

Your own command can catch the signal, so test your trap using ex. date+sleep.
Do you get same result ?

Some shells not work correctly using function, but old sh style defination like funcname() works fine.