News:

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

Dialog, listview and tab control

Started by newAsm, February 06, 2008, 12:50:21 AM

Previous topic - Next topic

newAsm

Hi,
I am new in Win32 assembly and learning to use it.

I started to learn to use RadAsm and found it to be very good. I created a project using the TabControl.tpl to create a project that uses dialog and a tab control. The tab control has three pages. The first two tab pages contains edit static labels, and buttons. The third tab page is a listview control. RadAsm setup the .rc using the visual control editor so the controls are easily setup and the rc files created.

When I first created the 1st two pages whenever I clicked on the 1st two pages, I see the expected controls when the page tab is clicked. When I introduced the 3rd tab page, and inserted the listview control, compile and run, all three pages display the listview. IF I click on tab page 1, tab page 2, tab page 3 and then back to 1, I get the correct controls. This is problem number 1.

In the main dialog procedure DialogProc, in WM_INITDIALOG, the tab control and the tab pages are setup properly. In this case it allows me to view each tab pages.

Problem 2. The tab control included two button (created by default by the wizard, which I did not delete). I need to click onto an edit control to get the focus. When I press TAB key, it always set focus on one of the button. I tried using WM_CHAR to try to capture TAB or return or any other key, and it would not trigger.

Problem 3. Whenever, the return key is pressed, the application terminate or close. I tried looking up in Win32.hlp for information but unable to get much information out.

I created another program using DialogAsMain.tpl (in RadAsm), and ported the res, and most of the thing I have already done. The same effect of listview is seen. However, when I type TAB when I want to change focus from one edit control to another, the application"beep" me. At least, in this wizard, the application does not terminate.

One thing I liked about RasAsm is the ease to create controls. When I set the project options with "/Zi" to allow debug, I can debug my application using WinDbg. In using masm32 (Hutch), using QEditor, Windbg is not able to import the symbol table. Why?

I tried MASM32 and tried porting what I have done. I cannot get the tab control to appear. I did

OK..OK, RadAsm is like Visual Basic and I do not know much about Win32. It is hard to even find one now in book shops. Thus, said, please enlighten me. I have spend a few days (1 week) trying to work satisfactory.

There are three problems:

1. Listview control seen in all three tab pages after startup and required a sequential click of each page before the right controls can be seen.
2. How to capture Tab control and how to prevent the application from terminating when RETURN key is typed.
3. I included WM_CHAR, WM_KEYUP to capture TAB so that the focus can be passed on to the next control. It's impossible. I tried changing the TabIndex, but it preset itself.

Help..help..I am going bonkies and I have three three application. I have attached two zipped file (using 7z) for anyone interested to find out. Thanks.... newAsm   ::)

[attachment deleted by admin]

jj2007

Out of curiosity, I downloaded your project. The exe gives me "error loading system record" - attempts to open a file end with a GPF. Thus I lost the motivation to scroll through the other 78 files, sorry. You might consider starting with a smaller project, e.g. like the ones in \masm32\icztutes

Draakie

Does this code make me look bloated ? (wink)

newAsm

Hi,

I read your comments. Sorry, for a VERY slow reply. I got tired of assmbly for a while because I kept knocking my head against the wall. I received some comments and I used feedback from winasm.com as well. I used the tabcontrol.zip sample file and I reworked the previous example.

This file does the same, and whatever problems were fixed.

The error message, if you see it "Error loading system record", is a message when the application cannot find the database. There is nothing wrong. The application needs refinement. At the moment it is working.

It is a Password Wallet. Hopefully next revision will include encryption. Any comments for encryption that I can use? You can comment on the application, source etc.

Thanks for your help. They are appreciated....newAsm

[attachment deleted by admin]

jj2007


neo85

Quote from: newAsm on February 06, 2008, 12:50:21 AM
1. Listview control seen in all three tab pages after startup and required a sequential click of each page before the right controls can be seen.

Look into you code and I found this:

Wallet.inc
SelTab dd ?

Wallet.asm
.if eax!=SelTab
push eax
mov eax,SelTab
invoke ShowWindow,[hTabDlg+eax*4],SW_HIDE
pop eax
mov SelTab,eax
invoke ShowWindow,[hTabDlg+eax*4],SW_SHOWDEFAULT
.endif


I think you forgot to init the value of SelTab, so adding the following line into you source code may fix your 1st problem

...
.elseif eax==WM_INITDIALOG
mov SelTab, 2 ; Add this line to init SelTab
...

newAsm

Hi neo85,

Thank you very much for looking through the code. I have updated the code. You are right. I am now working to add encryption. The simple encryption code are completed but not tested. I have not been doing much time on it but would attempt more time on it, soon. I will update the code as I complete it.

Thanks a lot to everyone else for your comments and encouragements...GS