Changeset 841 for trunk/SchedulerView.cpp
- Timestamp:
- 1/2/2009 7:40:17 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/SchedulerView.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SchedulerView.cpp
r828 r841 420 420 } 421 421 } 422 // Here we just add it to the bootup sequence if it is on boot 422 423 // Here we just add it to the bootup sequence if it is on boot 423 424 if (scWhen == Reboot) 424 425 { 425 426 //Here we are setting the appropriate entry into the Registry Key : 426 //HKEY_ LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run427 //HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run 427 428 //The entry should be in Name - Data pair, where Name is the name of the application and Data is the path of the executable 428 429 CKey kReg; … … 430 431 CString m_strName; 431 432 char Fullname[260]; 432 char Filename[260];433 char Filename[260]; 433 434 char Extension[5]; 434 435 char Pathname[260]; … … 436 437 char *buffer = new char[260]; 437 438 438 if (kReg.Open(HKEY_ LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run"))439 if (kReg.Open(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run")) 439 440 { 440 441 GetModuleFileName(AfxGetInstanceHandle(),Fullname,sizeof Fullname); … … 470 471 default: 471 472 NODEFAULT; 472 };473 }; 473 474 kReg.SetValue(m_strExePath, psiItem->GetId()); 474 475 m_strExePath.ReleaseBuffer(); … … 476 477 } 477 478 } 478 UpdateList();479 UpdateList(); 479 480 480 481 LibrarySettings* plsTmp1 = tps.m_pPageFileMethodOptions->GetLibSettings(); … … 488 489 489 490 pDoc->CalcNextAssignment(); 490 pDoc->UpdateToolTip(); 491 pDoc->SaveTasksToDefault(); 492 493 494 491 pDoc->UpdateToolTip(); 492 pDoc->SaveTasksToDefault(); 495 493 } 496 494 } … … 555 553 TerminateThread(psiItem); 556 554 if (psiItem->GetSchedule() == Reboot) 557 {558 CKey kReg;559 if (kReg.Open(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run"))560 {561 kReg.DeleteValue(psiItem->GetId());562 kReg.Close();563 }564 }555 { 556 CKey kReg; 557 if (kReg.Open(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run")) 558 { 559 kReg.DeleteValue(psiItem->GetId()); 560 kReg.Close(); 561 } 562 } 565 563 566 564 // remove it from the queue just in case it happens to be there … … 739 737 pDoc->LogAction(IDS_ERROR_TIMER); 740 738 } 741 //Update Reboot Part 739 740 //Update Reboot Part 742 741 if (tps.m_pgSchedule.m_iWhen == Reboot) 743 742 { 744 743 //Here we are setting the appropriate entry into the Registry Key : 745 //HKEY_ LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run744 //HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run 746 745 //The entry should be in Name - Data pair, where Name is the name of the application and Data is the path of the executable 747 746 CKey kReg; … … 755 754 char *buffer = new char[260]; 756 755 757 if (kReg.Open(HKEY_ LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run"))756 if (kReg.Open(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run")) 758 757 { 759 758 GetModuleFileName(AfxGetInstanceHandle(),Fullname,sizeof Fullname);
Note: See TracChangeset
for help on using the changeset viewer.
