The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: jj2007 on September 20, 2008, 03:44:42 PM

Title: GetTextInput
Post by: jj2007 on September 20, 2008, 03:44:42 PM
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