EDIT: I just saw I wrote Dealy instead of Delay in the thread name.
Hello everyone.
I know that I have been posting alot of questions here lately but for this question I cant find any other help.
So anyway I have two functions, and I want one function to run, and then have the other one to run 2 seconds after the first one. The first thing I did was to use Sleep(2000);
but for some reason that pauses the program at the beggining, The first function wont start either.
Some of my code:
This startfunc is started when I press a button that I have(I'm using winApi).Code:void functionone(HWND name) { SendDlgItemMessage(name,5,LB_ADDSTRING,0,(LPARAM)"Text One"); } void functiontwo(HWND name) { SendDlgItemMessage(name,5,LB_ADDSTRING,0,(LPARAM)"Text Two"); } void startfunc(HWND name) { functionone(name); Sleep(2000); functiontwo(name); }
But the problem is that the first function wont start until 2 seconds after I press the button.