63792

win32 api edit control can't be selected or edited

Question:

I created an edit control using win32 api like this:

<blockquote>

CreateWindow("edit", "", WS_CHILD | WS_VISIBLE, 0, m_position, CONTROLS_WIDTH, EDITBOX_HEIGHT, m_editorWindow, (HMENU)GetNextComponentID(), m_instance, NULL)

</blockquote>

I can change the text from it using SetWindowText, but I can't select it or edit it's content - this is the purpose of an edit control, or not?:))

I read on MSDN <a href="http://msdn.microsoft.com/en-us/library/bb775458%28VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb775458%28VS.85%29.aspx</a> that I must use Edit_enable but I don't know where to find thin macro and I don't heave any idea how to enable editing. When I move the cursor over it the cursor changes to standard edit cursor.

Thank you for help!

Answer1:

Or you could try:

HWND myWindow = CreateWindow("edit", "", WS_CHILD | WS_VISIBLE, 0, m_position, CONTROLS_WIDTH, EDITBOX_HEIGHT, m_editorWindow, (HMENU)GetNextComponentID(), m_instance, NULL);

EnableWindow(myWindow, true);

Answer2:

It works with SetFocus(hwnd) function.

Answer3:

Have you tried:

GetDlgItem(EditControlID)->EnableWindow(TRUE); <hr />

lol Oops.

Recommend

  • How to insert string in edit control
  • How does MFC interpret SetWindowTextW(LPCTSTR)?
  • EN_PROTECTED and RichEdit
  • MFC application title
  • How can I make a 100% stacked chart with nvd3?
  • Launch powershell script from UWP app with FullTrustProcessLauncher class
  • jinja2 template not found and internal server error
  • iOS 6 dateFromString returns wrong date
  • Create a link to a web page that runs a Javascript function on the page
  • iOS Cordova first plugin - plugin.xml to inject a feature
  • Compress a file with GZipStream while maintaining its meta-data
  • Xamarin MonoAndroid Azure mobile service InsertAsync
  • How do I retrieve the user information of a user authenticated with Apache's mod_ldap?
  • How can I include If-None-Match header in HttpRequestMessage
  • Private IP address in reserved subnet range
  • How To Customize ASP.NET Chart Databound To SqlDataSource
  • Enabling DTD support in Sql Server
  • UWP/C# - Issue with AQS and USB Devices
  • Parse a date string in a specific locale (not timezone!)
  • Retrieving value from sql ExecuteScalar()
  • Display issues when we change from one jquery mobile page to another in firefox
  • DotNetZip - Calculate final zip size before calling Save(stream)
  • MySQL WHERE-condition in procedure ignored
  • ORA-29908: missing primary invocation for ancillary operator
  • Web-crawler for facebook in python
  • Do I've to free mysql result after storing it?
  • How to get next/previous record number?
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • trying to dynamically update Highchart column chart but series undefined
  • Load html files in TinyMce
  • Free memory of cv::Mat loaded using FileStorage API
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How do you join a server to an Active Directory (domain)?
  • How does Linux kernel interrupt the application?
  • LevelDB C iterator
  • How can i traverse a binary tree from right to left in java?
  • java string with new operator and a literal