Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6668995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:06:03+00:00 2026-05-26T03:06:03+00:00

Does anyone know how to change the Bluetooth device name programatically? Or where is

  • 0

Does anyone know how to change the Bluetooth device name programatically?
Or where is the device name stored?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:06:03+00:00Added an answer on May 26, 2026 at 3:06 am

    Resolved

    Here is the ready-to-go solution encapsulated into a class method.

    bool CBluetooth::ChangeLocalRadioName(LPTSTR newName)
    {
        LPTSTR instanceID = GetGenericBluetoothAdapterInstanceID();
    
        if (instanceID == NULL)
        {       
            //_tprintf(_TEXT("Failed to get Generic Bluetooth Adapter InstanceID\n"));
            return false;
        }
        LPTSTR instanceIDModified = new TCHAR[_tcslen(instanceID)];
        _tcscpy(instanceIDModified, instanceID); 
        find_and_replace(instanceIDModified, _TEXT("\\"), _TEXT("#"));
    
    
        HANDLE hDevice;
        TCHAR fileName[1024] = { 0 };   
        _tcscpy(fileName, _TEXT("\\\\.\\"));    
        _tcscat(fileName, instanceIDModified);
        _tcscat(fileName, _TEXT("#{a5dcbf10-6530-11d2-901f-00c04fb951ed}"));
    
        hDevice = CreateFile(fileName, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
    
        if (hDevice == INVALID_HANDLE_VALUE)
        {
            //_tprintf(_TEXT("Failed to open device. Error code: %d\n"), GetLastError());       
            return false;
        }
    
        //Change radio module local name in registry
        LPTSTR RMLocalName = newName;
        CHAR bufRMLocalName[256];
    
        HKEY hKey;
        TCHAR rmLocalNameKey[1024] = { 0 };
        LSTATUS ret;
        _tcscpy(rmLocalNameKey, _TEXT("SYSTEM\\ControlSet001\\Enum\\"));    
        _tcscat(rmLocalNameKey, instanceID);
        _tcscat(rmLocalNameKey, _TEXT("\\Device Parameters"));
    
        ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, rmLocalNameKey, 
            0L, KEY_SET_VALUE , &hKey);
    
        if(ret != ERROR_SUCCESS)
        {
            //_tprintf(TEXT("Failed to open registry key. Error code: %d\n"), ret);
            return false;
        }
    
        ret = RegSetValueEx(hKey, _TEXT("Local Name"), 0, REG_BINARY, 
            (LPBYTE)RMLocalName,strlen(RMLocalName));
    
        if (ret != ERROR_SUCCESS)
        {
            //_tprintf(TEXT("Failed to set registry key. Error code: %d\n"), ret);
            return false;
        }
    
        RegCloseKey(hKey);
    
        // This check decides what IO control code to use based on if we're in XP or Vista (and later). 
        OSVERSIONINFO osver;
        osver.dwOSVersionInfoSize = sizeof(osver);
        GetVersionEx(&osver);
    
        UINT ctlCode = (UINT)(6 > osver.dwMajorVersion ? 0x220fd4 : 0x411008);
        long reload = 4;  // tells the control function to reset or reload or similar...
        DWORD bytes = 0; // merely a placeholder
    
        // Send radio module driver command to update device information
        if (!DeviceIoControl(hDevice, ctlCode, &reload, 4, NULL, 0, &bytes, NULL))
        {
            //_tprintf(TEXT("Failed to update radio module local name. Error code: %d\n"), GetLastError());
            return false;
        }
    
    
    
        return true;
    
    }
    

    Thanks to: clumpter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to change the Bordercolor for a Datagridviewcell in c#? Here's
Does anyone know how to change the color of a row (or row background)
Does anyone know how to change the ReSharper color scheme in VS2008 SP1? I've
Does anyone know how to change the location of the svn tool used in
Does anyone know how to change the brush for a menu's background? This sounds
Does anyone know how to change icons in Silverlight outofbrowser application?
Does anyone know how to change the width of a uitableviewcontroller? I was thinking
Does anyone know how to change the size of a panel in the gui
Does anyone know of a way to change the height of a Page Header
Does anyone know how I can change the window state of a form, from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.