The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Krozgen on November 27, 2005, 11:24:25 PM

Title: Help with the Windows API
Post by: Krozgen on November 27, 2005, 11:24:25 PM
Hey... I'm sorry to post such a noobish question, but I'm having troubles with the basics of assembly. I've been through a bunch of assembly tutorials, but I'm still unsure how to get the text from an edit box in a dialog window. Actually, that's not true - I can get the text, but... well, okay, let me give my example.

I have a dialog window that drives my "mouse move" program. Its purpose is to help me learn about assembly and the Windows API by making my mouse move in nifty patterns. My problem is, I have an editbox on my dialog window in which I'd like to input a "radius" value. I'd like it to be abse to be the equivalent of a "double" or "float", but if that's not possible, then just an unsigned int will do. When I put "5" (without the quotes) into the box, and use GetDlgItemText (invoke GetDlgItemText, hWin, 150, OFFSET r, 10)... it returns the ASCII value of "5" in hex. Is there any way to convert this to a number?

*Phew* sorry that was so roundabout... I'm new to the forum, and am never quite good at saying what needs to  be said :) Thanks in advance.
Title: Re: Help with the Windows API
Post by: hutch-- on November 28, 2005, 12:12:56 AM
Krozgen,

Welcome on board. Go to the forum web site in the top right corner and check the reference material you need. The WIN32.HLP file is useful and the online MSDN is a lot more up to date.

PS: Thanks Jim  :red
Title: Re: Help with the Windows API
Post by: Jimg on November 28, 2005, 02:06:20 AM
Hi Krozgen, and welcome-

Hutch meant to type win32.hlp, his keyboard sticks.

The easiest would to be use GetDlgItemInt rather than GetDlgItemText.

If you download and install masm32, there are many, many libraries and routines included.

There are many conversion routines in masm32.lib itself.

If you want floating point, look at fpulib.hlp in the masm32 help folder.

Happy coding  :U

Title: Re: Help with the Windows API
Post by: Krozgen on November 28, 2005, 06:06:33 AM
Wow, thanks to both of you, Hutch and Jim. Yes, I'm sorry I didn't notice the FpuLib help file! Gah! It was so helpful... I was using DWORD instead of REAL, for one e.e;;;

Heh... well, sorry for the goofy question, and thanks for the answer. Here's to the future, ey?  :bg