News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to set and get in a Label control?

Started by RHL, February 29, 2012, 12:25:17 AM

Previous topic - Next topic

RHL

Hi all, I'm trying to get the characters in a label or write to
one but I have no idea how to do it, I thought of using it
FindWindow> FindWindowEx> sendMessage

this is how you do it?
by the way anyone knows a little tutorial on working with controls?
thanks  :bg

Gunner

When you create any control with CreateWindowEx, it returns a handle to the created control, save that value.  If  a control is created in a resource, then you can get the handle of the control in the parents WindowProc, usually in WM_INITDIALOG and  do:\
invoke  GetDlgItem, hDlg, CTLID where CTLID is the number you assigned the control in the resource file.

Now to set the text, you send controls messages
invoke   SendMessage, HandleToControl, WM_SETTEXT, 0, offset szStringToDisplay

To get the text of a control
invoke   SendMessage, HandleToControl, WM_GETTEXT, SIZEOFBUFFER, AddressOfBufferToGetString

The are not called labels, they are called static controls  :bg
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

RHL

 :clap: :dance: Thanks Gunner, I am making a small app ( my first app) that I think public in the forum :)