021
13.09.2002, 05:14 Uhr
~Dieter
Gast
|
Kann mir dan mal irgent wer zeigen wie das an meinem beispiel ausehen muss:
C++: |
{ CRegKey key; key.Create(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS",REG_NONE,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,NULL); key.SetValue(m_gamedir,"gamedir"); key.Close();
CRegKey key1; key1.Create(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS",REG_NONE,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,NULL); key1.SetValue(m_para,"para"); key1.Close();
CString m_priostr; CString m_prioreg; m_prio.GetWindowText(m_priostr);
if (m_priostr == "Echtzeit") { UpdateData(TRUE); m_prioreg = "REALTIME_PRIORITY_CLASS"; UpdateData(FALSE); }
if (m_priostr == "Hoch") { UpdateData(TRUE); m_prioreg = "HIGH_PRIORITY_CLASS"; UpdateData(FALSE); }
if (m_priostr =="Normal") { UpdateData(TRUE); m_prioreg = "NORMAL_PRIORITY_CLASS"; UpdateData(FALSE); }
if (m_priostr == "Niedrig") { UpdateData(TRUE); m_prioreg = "IDLE_PRIORITY_CLASS"; UpdateData(FALSE); }
CRegKey key2; key2.Create(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS",REG_NONE,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,NULL); key2.SetValue(m_prioreg,"prio"); key2.Close();
CRegKey key3; key3.Create(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS",REG_NONE,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,NULL); key3.SetValue("1","start"); key3.Close();
HKEY hKey; RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WRITE, NULL, &hKey, NULL); char gamedir[200]; unsigned long WertTyp; unsigned long nMaxLenge = 200; RegQueryValueEx(hKey, "gamedir", 0, &WertTyp, (unsigned char*)gamedir, &nMaxLenge); RegCloseKey(hKey);
HKEY hKey1; RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS",0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WRITE,NULL,&hKey1,NULL); char parameter[200]; unsigned long WertTyp1; unsigned long nMaxLenge1 = 200; RegQueryValueEx(hKey1, "para", 0, &WertTyp1, (unsigned char*)parameter, &nMaxLenge1); RegCloseKey(hKey1);
HKEY hKey2; RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\MysticSoft\\CSS",0,NULL,REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | KEY_WRITE,NULL,&hKey2,NULL); char prioreg[200]; unsigned long WertTyp2; unsigned long nMaxLenge2 = 200; RegQueryValueEx(hKey2, "prio",0,&WertTyp2,(unsigned char*)prioreg,&nMaxLenge2); RegCloseKey(hKey2);
CString a = parameter; char* b= gamedir; char zusammen[1000]; strcpy(zusammen,b); strcat(zusammen," "); strcat(zusammen,a);
unsigned long progin = 0;
if(strcmp(prioreg,"IDLE_PRIORITY_CLASS")==0) progin = IDLE_PRIORITY_CLASS;
CString test; test.Format("%d - %s",progin,prioreg); AfxMessageBox(test);
STARTUPINFO si = {sizeof(si)}; PROCESS_INFORMATION pi; CreateProcess(NULL,zusammen,NULL,NULL,TRUE,prioreg,NULL,NULL,&si,&pi);
if (CanExit()) CDialog::OnOK();
// REALTIME_PRIORITY_CLASS - Echtzeit // HIGH_PRIORITY_CLASS - Hoch // NORMAL_PRIORITY_CLASS - Normal // IDLE_PRIORITY_CLASS - Niedrig }
|
|