case WM_INITDIALOG:
return true;
case WM_COMMAND:
{
case IDC_BUTTON1:
CreateThread(0,0,(LPTHREAD_START_ROUTINE)Thread,0,0,0);
break;
}
return true;
Quote:
Just a snippet
I did Thread as void,cause i get same result with the script you postCode:case WM_INITDIALOG: return true; case WM_COMMAND: { case IDC_BUTTON1: CreateThread(0,0,(LPTHREAD_START_ROUTINE)Thread,0,0,0); break; } return true;
case WM_INITDIALOG:
return true;
case WM_COMMAND:
{
case IDC_BUTTON1:
if(isDlgButtonChecked(hwndDlg, IDC_BUTTON1) == BST_CHECKED)
CreateThread(0,0,(LPTHREAD_START_ROUTINE)Thread,0,0,0);
break;
}
return true;
Well,the point is that after it check if S4 is on,the checkbox func isn't get work :/Quote:
^Code:case WM_INITDIALOG: return true; case WM_COMMAND: { case IDC_BUTTON1: if(isDlgButtonChecked(hwndDlg, IDC_BUTTON1) == BST_CHECKED) CreateThread(0,0,(LPTHREAD_START_ROUTINE)Thread,0,0,0); break; } return true;
;)
void Thread()
{
Sleep(100);
while(isRunning("S4Client.exe")==false){}
MessageBoxA(Dlg,"Test","Test1",MB_OK);
if(IsDlgButtonChecked(Dlg,IDC_CHECK1))
{
MessageBoxA(Dlg,"Test","Test2",MB_OK);
}
}
Quote:
Well,the point is that after it check if S4 is on,the checkbox func isn't get work :/
The first one works,but when i click CHECK1 no msg :/Code:void Thread() { Sleep(100); while(isRunning("S4Client.exe")==false){} MessageBoxA(Dlg,"Test","Test1",MB_OK); if(IsDlgButtonChecked(Dlg,IDC_CHECK1)) { MessageBoxA(Dlg,"Test","Test2",MB_OK); } }
I've use it for a Dll also,and it pretty worked,but it was in the loop
DWORD WINAPI Thread(LPVOID lpParam)
{
Sleep(100);
while(isRunning("S4Client.exe")==false){}
MessageBoxA(Dlg,"Test","Test1",MB_OK);
if(IsDlgButtonChecked(Dlg,IDC_CHECK1) == BST_CHECKED)
{
MessageBoxA(Dlg,"Test","Test2",MB_OK);
}
return TRUE;
}
void Thread()
:facepalm:Quote:
Originally Posted by msdnDo not declare this callback function with a void return type and cast the function pointer to LPTHREAD_START_ROUTINE when creating the thread