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 8357545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:30:51+00:00 2026-06-09T10:30:51+00:00

I have a series of values from some VB6 code I found online .

  • 0

I have a series of values from some VB6 code I found online. I need this code converted to C#. I have no idea how to read VB6. How can I convert this VB6 to the equivalent C#?

Private Const EM_GETRECT = &HB2;
Private Const EM_SETRECT = &HB3
Private Const EM_SCROLLCARET = &HB7

Private Const ES_AUTOHSCROLL = &H80&
Private Const ES_AUTOVSCROLL = &H40&
Private Const ES_CENTER = &H1&

Judging by one signature

[DllImport("coredll.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);

that takes these types of variables (as the Msg param), I believe these should be of the form

const int EM_GETRECT =

I don’t know how to change the &HB2 to an int. I think it’ll be 0x???, but how do I convert this little &HB2 to hex?

  • 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-06-09T10:30:53+00:00Added an answer on June 9, 2026 at 10:30 am

    The syntax to express an hexdecimal value in C# is simply 0x followed by the hex representation of the number. (And this representation is the same in VB6 and C#) so you write

    private const int EM_GETRECT = 0xB2;
    Console.WriteLine(EM_GETRECT);
    

    prints out 178 decimal.

    The last three values (with the & suffix) are VB variables of long datatype.
    In C# the datatype int is the same as VB long.
    You could still use a C# integer

    private const int ES_CENTER = 0x1; 
    Console.WriteLine(ES_CENTER);
    

    prints 1 as expected

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

Sidebar

Related Questions

I need some help with a query. I have this simple table: CREATE TABLE
I'm trying to load some decimal values from a file but I can't work
i need some help with this problem. I have a binary tree stucture which
So I have a time series of MODIS NDVI values (vegetation values from 0-1
I have a series of grouped values that follow a specific format and would
I have an xts time series of weekly values Jan 4 2004, 0.99 Jan
I have created an application that records a series of longitude and latitude values
I have a series of if statements in a function like this: if time
I have a series of... pseudo-xml files. What I mean by this, is they
I have a series of divs that slide down using -webkit-transform from a negative

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.