News:

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

PopUp Window

Started by RuiLoureiro, August 27, 2008, 09:10:52 PM

Previous topic - Next topic

RuiLoureiro

MichaelW,  Thanks.
           About SetTimer it is what i expected.
           I have one doubt about RegisterClassEx. It seems to me that we dont
           need to define more than one place to WNDCLASSEX structure. If i need
           to register 5 different classes ClassPopupX, ClassPopupY, ClassPopupZ
           ClassChildU and ClassChildV we can do it calling RegistaClass (see below)
           5 times at the beginning of our program (for example) and after this
           we use CreateWindowEx/DestroyWindow to create/destroy the windows of one
           of those 5 classes. No? Am i wrong?

.data?
_wc      WNDCLASSEX <?>
;---------------------------
.code
...
RegistaClass        proc  pClass:DWORD, pProc:DWORD

                    mov     _wc.cbSize,      SIZEOF WNDCLASSEX
                    mov     _wc.style,       WS_STYLE0          ; style
                    mov     _wc.cbClsExtra,  NULL
                    mov     _wc.cbWndExtra,  NULL
                    push    _hInstance                          ; Instance
                    pop     _wc.hInstance
                    mov     _wc.hbrBackground, COLOR_BACKGROUND+1           
                    mov     _wc.lpszMenuName, NULL                   
                    mov     _wc.hIcon, NULL
                    mov     _wc.hCursor, NULL
                    mov     _wc.hIconSm, NULL

                    mov     eax, pClass                          ; name of windows class
                    mov     _wc.lpszClassName, eax
                    ;                   
                    mov     eax, pProc                           ; procedure name
                    mov     _wc.lpfnWndProc, eax   
                   
                    invoke  RegisterClassEx, addr _wc
                    ret
RegistaClass        endp


        My ChildWindows doesnt work correctly in my main program
            (i have another prog where i want to use it)
. Between OpenExecMsg
        and CloseExecMsg, when the processor is doing some tasks, if i try
        to move the child window it stops the normal processing tasks.
        It seems i need to create another thread. No MichaelW?

        Thank you for your answers

Rui

MichaelW

Reusing a single class would be more efficient, and if the windows all follow that same pattern, should produce the same result.

I don't know what's going on in your other program, but with child16.exe my attempts to move a child window show only a 1 percent CPU usage, which seems very normal to me.

eschew obfuscation

RuiLoureiro

MichaelW,  Thanks.
           Whats going on in my other program is what i want to know.
           Meanwhile i clicked on one folder where i have files used to assemble
           the program and the contents of it disappeared. Worst: the solution is
           to redo all files from a backup folder. It is not happen to me !

           Now, 2 things: In one case the CPU usage is 54% and in 2 other cases
           it happens that the MessageBoxes doesnt appear (see below). If i remove
           OpenExecMsg everything works normally. Why ? How to force it to appear


         invoke  OpenExecMsg, 44          <- open child window  
         invoke  DoSomething, p1, p2, ... <- here i use some MessageBoxes
         call    CloseExecMsg             <- close child window
               
           Now i am going to redo the files.
           Thank you MichaelW
Rui       

RuiLoureiro

Hello all,
           MichaelW, i caught the "cat" and the problem of MessageBoxes is solved.
           After using OllyDbg (results=0) and experimenting some cases
           It is working correctly.
           
           To show the problem with MessageBoxes i attached the files:
Quote     
     * Child18.zip (asm & exe ) - it uses PasMsgPr  -> uses GetDC to print msg
                                                                              inside Child Window

     * Child19.zip (asm & exe ) - it uses PrPasMsg  -> uses BeginPaint to print msg
                                                                              inside Child Window
    Try this:
              . run Child18.exe and choose Child -> Open Child msg1
                (we dont see the MessageBox)
              . press Enter to exit from MessageBox and to close the Child window

    Now,
              . run Child19.exe and choose Child -> Open Child msg1
                (we see the MessageBox)

            Thanks
Rui

[attachment deleted by admin]