The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: arroso on July 26, 2008, 12:12:32 PM

Title: navigating thru controls in a dialog with TAB key
Post by: arroso on July 26, 2008, 12:12:32 PM
Hi everybody,
I'll like to know the requirements for me to navigate thru the controls of a dialog by TAB key.
Actually I have a dialog created with CreateDialogParam
All useful controls have the WS_TABSTOP set
The behaviour I got is a cursor stuck on the first control and unresponsive TAB key.

Any hint?
Thanks in advance
Title: Re: navigating thru controls in a dialog with TAB key
Post by: Tedd on July 26, 2008, 04:27:10 PM
You need to add IsDialogMessage into your message-loop (after GetMessage) :wink
Title: Re: navigating thru controls in a dialog with TAB key
Post by: arroso on July 28, 2008, 01:05:29 PM
thank you very much, you saved me  :bg
haven't found any hint related within the WinApi text
Title: Re: navigating thru controls in a dialog with TAB key
Post by: Rsir on July 31, 2008, 02:37:11 PM
To tab through your edit boxes

In WinMain proc
replace :

Quote.while TRUE
   invoke GetMessage,addr msg,NULL,0,0
     .BREAK .if !eax
   invoke TranslateMessage,addr msg
   invoke DispatchMessage,addr msg
.endw

with :
Quote
.WHILE TRUE
   invoke GetMessage, ADDR msg,NULL,0,0
   .BREAK .IF (!eax)
   invoke IsDialogMessage, hWnd, ADDR msg
   .IF (!eax)
      invoke TranslateMessage,addr msg
      invoke DispatchMessage,addr msg
   .ENDIF
.ENDW

You also have to adjust the settings of Tabstop (true) and Tabindex (#)
Found this in Ranma_at's tutorial#6 via the RadASM site   
http://www.radasm.com/    ... RadASM tutorials by Ranma_at   (11-13-2003)

RsiR