News:

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

GetTextInput

Started by jj2007, September 20, 2008, 03:44:42 PM

Previous topic - Next topic

jj2007

InsHyperlink proc
LOCAL LocBuf[256]:BYTE
  push esi
  lea esi, LocBuf
  invoke GetTextInput, hOwn, hInstance, 0, pApp, chr$("Insert hyperlink"), esi
  .if what?
... do stuff ...
  .endif
  pop esi
  ret
InsHyperlink endp


The MasmLib docu says:

Return Value
The return value in EAX is always zero.

Comments
To test if the user has entered text, the first byte of the buffer should be tested for zero. If the value is not zero, the buffer contains the text typed by the user.

I was about to discard this function, then decided to try my luck. And yep, even if there is text in the box, [esi] will be zero if the user pressed Cancel. For readability, I suggest to add:

Comments
To test if the user has entered text, the first byte of the buffer should be tested for zero. If the value is not zero, the buffer contains the text typed by the user. If the buffer is empty, or if the user pressed Cancel, the value will be zero.

A propos readability: An option to use another font would be great :eek