3 Replies Latest reply on Oct 13, 2017 9:17 AM by Philip Koester

    OEM Name recall - MC32N0 WinCE 7.0

    Philip Koester

      Hello,

       

      i have short question. On my Symbol devices in the Control Panel their you can find the app System Info.

      In "System Info" at the first Page, you can find the label "OEM Name". Do you know from which dll or registry entry the program get's these Informations?

      I need these informations for a self developed program in c#.

       

      Yours faithfully

        • Re: OEM Name recall - MC32N0 WinCE 7.0
          Joydeep Chakraborty

          SystemParametersInfo (Windows CE 5.0)

          I have tried this in VC++ and worked for me.

           

          TCHAR szPlatform[MAX_PATH+1];

          memset(szPlatform, 0, MAX_PATH*sizeof(TCHAR));

          SystemParametersInfo(SPI_GETOEMINFO, MAX_PATH, szPlatform, 0);

           

           

          Please try Pinvoke on C++ dll and call it from managed code.

          I thik you will get in User32.dll.

           

          Regards,

          Joydeep

            • Re: OEM Name recall - MC32N0 WinCE 7.0
              Daniel Silva

              C# code (forgive the formatting):

               

              [System.Runtime.InteropServices.DllImport("coredll.dll",SetLastError = true)]

              public static extern int SystemParametersInfo(

              int uiAction,int uiParam,StringBuilder pvParam,int fWinIni);

               

               

              public const int SPI_GETOEMINFO = 258;

               

              static string GetOEMName()

              {

              try

              {

               

              StringBuilder OEMInfo = new StringBuilder(64,64);

               

               

              int details = SystemParametersInfo(SPI_GETOEMINFO, OEMInfo.Capacity, OEMInfo, 0);

              if (details != 0)

              {

              return OEMInfo.ToString();

              }

              else

              {

              return "";

              }

              }

              catch

              {

              return "";

              }

               

               

              }

            • Re: OEM Name recall - MC32N0 WinCE 7.0
              Philip Koester

              Hello,

               

              thanks a lot for so much help. For the C++ and for the C# Code. I worte my own C# Code meanwhile.

               

              public enum SPIF
              {
                  None = 0x00,
                  /// <summary>Writes the new system-wide parameter setting to the user profile.</summary>
                  SPIF_UPDATEINIFILE = 0x01,
                  /// <summary>Broadcasts the WM_SETTINGCHANGE message after updating the user profile.</summary>
                  SPIF_SENDCHANGE = 0x02,
                  /// <summary>Same as SPIF_SENDCHANGE.</summary>
                  SPIF_SENDWININICHANGE = 0x02
              }

               

                  [DllImport("Coredll.dll", CharSet = CharSet.Auto, SetLastError = true)]
                  [return: MarshalAs(UnmanagedType.Bool)]
                  public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, StringBuilder pvParam, SPIF fWinIni);

               

                      StringBuilder stringBuilder = new StringBuilder((int) SystemInfo.MAX_PATH + 1);
                      SystemInfo.SystemParametersInfo(SystemInfo.SPI_GETOEMINFO, SystemInfo.MAX_PATH, stringBuilder, SPIF.None);
                      systemInformationMessage.Control = UpdateShare.SystemInfo.GetWindowsVersion() + "*" + stringBuilder.ToString();
                      _connection.SendMessage(systemInformationMessage);

               

              Yours faithfully