void writeMRU() { TCHAR szMRU[MAX_PATH]; wsprintf(szMRU, L";", myDlgItems[0].szValue); if(OpenCreateKey(L"Software\\Microsoft\\Terminal Server Client")==0) { if (RegWriteStr(L"MRU", szMRU)==0) DEBUGMSG(1, (L"WriteReg OK: %s=%s\n", L"Software\\Microsoft\\Terminal Server Client", myDlgItems[0].szValue)); else DEBUGMSG(1, (L"WriteReg #failed#: %s=%s\n", L"Software\\Microsoft\\Terminal Server Client", myDlgItems[0].szValue)); } const int Size = 20; char OutBuff[Size]; unsigned long OutBytes = 0; KernelIoControl(IOCTL_HAL_GET_DEVICEID, 0, 0, OutBuff, Size, &OutBytes); }
BOOL writeReg(){ BOOL bRet=FALSE; OpenCreateKey(L"Software\\Intermec\\RebootDialog2"); if(! RegWriteStr(L"CleanBootText", _stringTable.szCleanBoot)==ERROR_SUCCESS) bRet=FALSE; if(! RegWriteStr(L"SuspendText", _stringTable.szSuspend)==ERROR_SUCCESS) bRet=FALSE; if(! RegWriteStr(L"RebootText", _stringTable.szReboot)==ERROR_SUCCESS) bRet=FALSE; if(! RegWriteStr(L"ShutdownText", _stringTable.szShutdown)==ERROR_SUCCESS) bRet=FALSE; if(! RegWriteStr(L"CancelText", _stringTable.szCancel)==ERROR_SUCCESS) bRet=FALSE; if(! RegWriteStr(L"QuestionText", _stringTable.szQuestion)==ERROR_SUCCESS) bRet=FALSE; return bRet; }
void WriteReg() { Add2Log(L"In WriteReg()...\r\n", FALSE); int i; TCHAR name[MAX_PATH+1]; //this is for CN2 kMap[0].keyCode= 114; //F3 wsprintf(kMap[0].keyCmd, L"\\windows\\iRotateCN2.exe"); wsprintf(kMap[0].keyArg, L""); kMap[1].keyCode= 115; //F4 wsprintf(kMap[1].keyCmd, L"\\windows\\LockTaskBar.exe"); wsprintf(kMap[1].keyArg, L"-toggle"); kMap[2].keyCode= 116; //F5 wsprintf(kMap[2].keyCmd, L"\\windows\\iSIP2.exe"); wsprintf(kMap[2].keyArg, L""); kMap[3].keyCode= 113; //F2 wsprintf(kMap[3].keyCmd, L"explorer.exe"); wsprintf(kMap[3].keyArg, L""); kMap[4].keyCode= 27; //ESC wsprintf(kMap[4].keyCmd, L"\\windows\\iKill2.exe"); wsprintf(kMap[4].keyArg, L"iRun2.exe"); //for 700 keyb map has to be rewritten //and use different keys (A1 to A4 should map to F1 to F4) OpenCreateKey(L"Software\\Intermec\\iHook3"); for (i=0; i<5; i++) { wsprintf(name, L"key%i", i); RegWriteByte(name, kMap[i].keyCode ); wsprintf(name, L"exe%i", i); RegWriteStr(name, kMap[i].keyCmd ); wsprintf(name, L"arg%i", i); RegWriteStr(name, kMap[i].keyArg ); } RegWriteByte(L"ForwardKey", 0); RegWriteByte(L"UseLogging", 0); CloseKey(); Add2Log(L"Out WriteReg()...\r\n", FALSE); //return 0; }
void writeReg() { if(OpenCreateKey(L"Software\\RDP_autologin")==0) { for (int i=0; i<COUNT_DLG_ITEMS; i++) { if (RegWriteStr(myDlgItems[i].szLabel, myDlgItems[i].szValue)==0) DEBUGMSG(1, (L"WriteReg OK: %s=%s\n", myDlgItems[i].szLabel, myDlgItems[i].szValue)); else DEBUGMSG(1, (L"WriteReg failed: %s=%s\n", myDlgItems[i].szLabel, myDlgItems[i].szValue)); } if(RegWriteStr(L"FullScreen", L"1")==0) DEBUGMSG(1, (L"WriteReg OK: FullScreen=1\n")); else DEBUGMSG(1, (L"WriteReg FAILED: FullScreen=1\n")); g_bUseFullscreen=false; if(RegWriteStr(L"FitToScreen", L"0")==0) DEBUGMSG(1, (L"WriteReg OK: FitToScreen=0\n")); else DEBUGMSG(1, (L"WriteReg FAILED: FitToScreen=0\n")); g_bUseFitToScreen=false; if(RegWriteDword(L"DesktopWidth", &iDesktopWidth)==0) DEBUGMSG(1, (L"WriteReg OK: DesktopWidth=%u\n", iDesktopWidth)); else DEBUGMSG(1, (L"WriteReg FAILED: DesktopWidth=%u\n", iDesktopWidth)); if(RegWriteStr(L"UseMouseClick", L"0")==0) DEBUGMSG(1, (L"WriteReg OK: UseMouseClick=0\n")); else DEBUGMSG(1, (L"WriteReg FAILED: UseMouseClick=0\n")); bUseMouseClick=false; if(RegWriteDword(L"DesktopHeight", &iDesktopHeight)==0) DEBUGMSG(1, (L"WriteReg OK: DesktopHeight=%u\n", iDesktopHeight)); else DEBUGMSG(1, (L"WriteReg FAILED: DesktopHeight=%u\n", iDesktopHeight)); wsprintf(sAppOnExit, L"\\Windows\\rdp_keepbusy.exe"); if(RegWriteStr(L"StartOnExit", sAppOnExit)==0) DEBUGMSG(1, (L"WriteReg OK: sAppOnExit='%s'\n", sAppOnExit)); else DEBUGMSG(1, (L"WriteReg FAILED: sAppOnExit='%s'\n", sAppOnExit)); // "execargs"="noRDPstart" if(RegWriteStr(L"ExecArgs", sExeArgs)==0) DEBUGMSG(1, (L"WriteReg OK: sExeArgs='%s'\n", sExeArgs)); else DEBUGMSG(1, (L"WriteReg FAILED: sExeArgs='%s'\n", sExeArgs)); //color depth if(RegWriteDword(L"ColorDepth", &dwColorDepth)==0) DEBUGMSG(1, (L"WriteReg OK: ColorDepth=%u\n", dwColorDepth)); else DEBUGMSG(1, (L"WriteReg FAILED: ColorDepth=%u\n", dwColorDepth)); //drive redirection if(RegWriteDword(L"EnableDriveRedirection", &dwEnableDriveRedirection)==0) DEBUGMSG(1, (L"WriteReg OK: EnableDriveRedirection=%u\n", dwEnableDriveRedirection)); else DEBUGMSG(1, (L"WriteReg FAILED: EnableDriveRedirection=%u\n", dwEnableDriveRedirection)); //audio redirection if(RegWriteDword(L"AudioRedirectionMode", &dwAudioRedirectionMode)==0) DEBUGMSG(1, (L"WriteReg OK: AudioRedirectionMode=%u\n", dwAudioRedirectionMode)); else DEBUGMSG(1, (L"WriteReg FAILED: AudioRedirectionMode=%u\n", dwAudioRedirectionMode)); } }