News:

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

Help with the Windows API

Started by Krozgen, November 27, 2005, 11:24:25 PM

Previous topic - Next topic

Krozgen

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.

hutch--

#1
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
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Jimg

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


Krozgen

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