Hi KetilO,

Is there an add-in message to use to know when a dialog is opened. ( Like AIM_EDITOPEN only for Dlg.) The only thing I can get working is by using the AIM_TOOLSHOW message, but I don't think that's proper.

Thanks,
Wayne
Posted on 2002-10-18 14:47:55 by Wayne
Hi Wayne

In the FlipCase addin you can find this:

	.elseif eax==AIM_MDIACTIVATE

;Always return FALSE
;hWin handle of mdi child
;wParam hwndChildDeact child being deactivated
;lParam hwndChildAct child being activated
;Added by NEMO
;Get ID of RichEdit or dialog
invoke GetWindowLong,hWin,0
.if eax==ID_DIALOG
mov eax,hWin
.if eax==lParam
;MDI child is beeing activated
mov nHideToolBox,0
;Show the toolbox
invoke ShowToolBox,TRUE
.elseif eax==wParam
;MDI child is beeing deactivated
;Delay the hiding a little
mov nHideToolBox,1
.endif
.endif


KetilO
Posted on 2002-10-18 15:37:24 by KetilO
KetilO,

Thank you. I did not think to look at flipcase or even the
Addin template. I was kinda lost because I did'nt know any of the parameter values passed with messages.(Even thought they are well documented.) I will look more before I post questions. It's been a bad week.

Thanks again,
Wayne
Posted on 2002-10-18 18:24:24 by Wayne
I'm back,
What I am trying to do is get the handle of the topmost dialog when it is activated. The code above just tells me that a dialog is about to be activated but I have not found a way get which dialog it is and the handle. I've tried to get the topmost dialog from hDialog in ADDINHANDLES struct, but it just returns 0 probably because the dialog isn't active yet.

Any ideas on how to accomplish this?

Wayne
Posted on 2002-10-19 15:43:06 by Wayne
Hi Wayne

Yes, this is a problem when the mdi-child is created because the dialog is not created yet.
My only suggestion is to flag the timer pretty much the way it is done in the FlipCase addin.

KetilO
Posted on 2002-10-19 16:40:21 by KetilO
KetilO,

Flagging the timer seems to work well. Thanks for your suggestion. I just thought I might be missing something else so that's why I asked.

Thanks
Wayne
Posted on 2002-10-19 21:24:05 by Wayne
Hi KetilO,

I feel really lost on this one. I think I do not understand the DIALOG structures!

What I'm trying to do : Now that I know a dialog has been activated, I wish to 'walk' thru the DIALOG structures and get the Control ID and Classname. ( Much like DlgToWin.)
The code below is a rip from DlgtoWin. From looking at it I assume that past the DLGHEAD are contiguous DIALOG structs that hold control info.(The first being the dialog box).
But when I run the code below I only see the first(dialog) and no others. All the following DIALOG's are 0. This seemed strange to me because DlgtoWin works. So, I rebuilt DlgToWin and it now does'nt work. The D2W code I have is from Ver. 1.1.0.7. So I'm wondering did something change or am I just lost on how this works?




.elseif uMsg==AIM_TIMER
.if DlgActivate && nTicks
mov DlgActivate, FALSE
; mov eax,lpHStruct
; mov eax,(ADDINHANDLES ptr [eax]).hDialog
; PrintHex eax
; invoke EnumChildWindows,eax, addr EnumChildProc, 0
mov eax,lpHStruct
mov eax,ADDINHANDLES.hMdiCld[eax]
invoke GetWindowLong,eax,4
mov esi,eax
add esi,sizeof DLGHEAD
NxCtl:
mov eax,DIALOG.id[esi]
; PrintText "id"
PrintHex eax
@@:
add esi,sizeof DIALOG
cmp DIALOG.hwnd[esi],-1
je @b
cmp DIALOG.hwnd[esi],0
jne NxCtl
.endif
.endif
mov eax,FALSE
ret



Thanks,
Wayne
Posted on 2002-10-20 18:36:16 by Wayne
Hi Wayne

The reason is that you are using a dialog structure version below 1.2.0.0
In 1.2.0.0 the caption lenght was changed from 32 to 241 bytes.

KetilO
Posted on 2002-10-21 00:56:30 by KetilO
Hi KetilO,

Thanks for your patience. Once again I did not search enough for the answer. I just went back and looked at posts when 1.2.1.0 was released and sure enough there was a 'flipcase' download I had not got.

One suggestion though: For people who do not how search for existing info(like me), could you add 'flipcase.txt' to future releases. Or maybe even a seperate download for addin projects you wish to release. They are really quite valuable in learning.

Thanks again,
Wayne
Posted on 2002-10-21 09:02:18 by Wayne
Hi Wayne

I plan to move some RadASM structures to RadASM.inc. That should solve the problem.
On my web page there is a seperate download for addins. They should be up to date.

KetilO
Posted on 2002-10-21 09:24:34 by KetilO
Hi KetilO,

MY last post until I learn to open my eyes. I'm going through a moron week. I'm so sorry for bothering you.
My bookmark for your website went right to the RADASM download page. Imagine my suprise when I found the Main page. Da! I think I'll take a little vaction.

Thanks
Posted on 2002-10-21 10:30:37 by Wayne