This depends.
If the method called by CreateThread ever hits a breakpoint while you are stepping through the code that called CreateThread then the debugger will switch to that breakpoint and thread. From then on (until you hit F5 again) doing step over instructions (F10) will occasionally alternate between the original thread and the one created by CreateThread.
This is true for every thread which is created during a given break session. Once you hit F5 though and break again (via breakpoint or pause) everything resets and stepping will only step through the thread which was originally broken into.
Here's an example app
DWORD WINAPI Thread2(LPVOID lParam)
{
while (true)
{
printf("In Thread 2\n");
}
}
int _tmain(int argc, _TCHAR* argv[])
{
CreateThread( NULL, 0, &Thread2, NULL, 0, NULL);
while (true)
{
printf("In Thread 1\n");
}
return 0;
}
If I put a breakpoint on the printf function in _tmain hit F5 and then use F10 to step after the breakpoint is hit I will never step into the Thread2 method.
However if I put a breakpoint on both the entry point to _tmain and Thread2 and then hit F5 things change. First I will hit the breakpoint in _tmain as expected. If I keep hitting F10 after that I will eventually hit the breakpoint in Thread2. From then on I can keep hitting F10 and it will alternate between the two threads ever few steps.
Note: This is not because I keep hitting the breakpoints. Both of the breakpoints are hit only once since they're at the method entry point. It's simply the debugger behavior to alternate between threads which have been explicitly broken into for a given stop in the debugger.