News:

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

Problems with Toolbars and Status windows

Started by Phedge34, April 08, 2005, 02:19:19 AM

Previous topic - Next topic

Phedge34

Here is what I am doing...

        invoke CreateWindowEx,NULL,TOOLBARCLASSNAME,NULL,WS_CHILD or\
                              CCS_ADJUSTABLE,0,0,0,0,hWnd,ID_TOOLBAR,\
                              hInstance,NULL
        mov hToolBar, eax

        invoke CreateWindowEx,NULL,STATUSCLASSNAME,NULL,WS_CHILD or\
                              CCS_ADJUSTABLE,0,0,0,0,hWnd,ID_STATBAR,\
                              hInstance,NULL
        mov hStatus, eax

This is the result...

Assembling: C:\masm32\Projects\Template\TEMPLATE.asm
C:\masm32\Projects\Template\TEMPLATE.asm(191) : error A2006: undefined symbol : TOOLBARCLASSNAME
C:\masm32\Projects\Template\TEMPLATE.asm(191) : error A2114: INVOKE argument type mismatch : argument : 2
C:\masm32\Projects\Template\TEMPLATE.asm(290) : error A2006: undefined symbol : STATUSCLASSNAME
C:\masm32\Projects\Template\TEMPLATE.asm(290) : error A2114: INVOKE argument type mismatch : argument : 2

Anyone know how to fix/get around this?

mnemonic

I don't think that you provided the full source, but anyway...
This is what Win32.hlp says about CreateWindowEx:
HWND CreateWindowEx(

    DWORD dwExStyle, // extended window style
    LPCTSTR lpClassName, // pointer to registered class name
    LPCTSTR lpWindowName, // pointer to window name
    DWORD dwStyle, // window style
    int x, // horizontal position of window
    int y, // vertical position of window
    int nWidth, // window width
    int nHeight, // window height
    HWND hWndParent, // handle to parent or owner window
    HMENU hMenu, // handle to menu, or child-window identifier
    HINSTANCE hInstance, // handle to application instance
    LPVOID lpParam // pointer to window-creation data
   );


About lpClassName it says:
lpClassName

Points to a null-terminated string or is an integer atom.
If lpClassName is an atom, it must be a global atom created by a previous call to GlobalAddAtom.
The atom, a 16-bit value less than 0xC000, must be in the low-order word of lpClassName;
the high-order word must be zero.
If lpClassName is a string, it specifies the window class name.
The class name can be any name registered with the RegisterClass function or any of the
predefined control-class names.


I don't think you are providing CreateWindowEx a pointer to some string, do you?
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

Darrel

In the data section

.data
TOOLBARCLASSNAME  BYTE  "MyWackyToolBar",0
STATUSCLASSNAME   BYTE "MyWackySataus",0

In your Invoke Statements replace:

TOOLBARCLASSNAME with ADDR TOOLBARCLASSNAME
STATUSCLASSNAME with ADDR STATUSCLASSNAME

This will solve that problem  :dance:

Phedge34

TOOLBARCLASSNAME and STATUSCLASSNAME are Windows classes.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/common/classes.asp

They are most likely supposed to be defined in the windows.inc file.  What I am basically looking for are the constant values for these two classes...I think.

mnemonic

Hmmm... looks like you were dealing with CommonControls.
The only advice I can give you is to have a look at Iczelion's tutorials, especially this one.
You should find a way from there on.
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

Phedge34

Yeah, I am actually working off of his tutorial.  I was hoping to use the new way of creating a toolbar as M$ says, "Note   This function[CreateStatusWindow] is obsolete. Use CreateWindow instead."

mnemonic

Sorry, but I don't see the point.
He uses:
invoke CreateWindowEx,NULL,ADDR ProgressClass,NULL,\
            WS_CHILD+WS_VISIBLE,100,\
            200,300,20,hWnd,IDC_PROGRESS,\
            hInstance,NULL

with ProgressClass being:
ProgressClass  db "msctls_progress32",0       ; the class name of the progress bar
He uses CreateWindowEx the same way as you are trying but with the class name instead of the constant (which obviously doesn't work however).
Be kind. Everyone you meet is fighting a hard battle.--Plato
-------
How To Ask Questions The Smart Way

Phedge34

Hmmm... I lied.  I thought I was working off his tutorial but I was confused. I was working off of some other lame ass tutorial I found at websters.cs.ucr.edu.  That table he has at the begining is exactly what I need.  Thanks, sorry for the trouble.