Hi
While playing with docking windows to get my addin to (finally) work with them, I found a couple of bugs:

1) Undock a window. Dock it anywhere. Dock it to the OPPOSITE side of the screen. Oops!

2) This may not be a bug in WinAsm... but I could really use some help here.
The addin is not saving the DOCKINGDATA structur properly when the window is docked (works fine when undocked at addin unloading). I've tried changing akyprian's sample to store it's last used position when unloading the addin... try it and see for yourselves.

Hope it can be fixed soon! ;)

Cheers
Posted on 2003-11-05 17:35:57 by QvasiModo

Hi
While playing with docking windows to get my addin to (finally) work with them, I found a couple of bugs:

1) Undock a window. Dock it anywhere. Dock it to the OPPOSITE side of the screen. Oops!

2) This may not be a bug in WinAsm... but I could really use some help here.
The addin is not saving the DOCKINGDATA structur properly when the window is docked (works fine when undocked at addin unloading). I've tried changing akyprian's sample to store it's last used position when unloading the addin... try it and see for yourselves.

Hope it can be fixed soon! ;)

Cheers


Hi!

1.I do not see any Oops! Are you using V2.0.0.2b? What do you see? Any other users have any problem?

2.You are doing 2 major mistakes:

a)The structure is

DOCKINGDATA STRUCT
lpCaption DWORD ?
fDockedTo DWORD ? ;1=left,2=right,3=top,4=bottom,5=NoDock
NoDock POSANDSIZE <?>
DockTopHeight DWORD ?
DockBottomHeight DWORD ?
DockLeftWidth DWORD ?
DockRightWidth DWORD ?

;Do not touch these!
reserved1 DWORD ?
reserved2 DWORD ?
reserved3 RECT <?>
reserved4 POINT <?>
DOCKINGDATA ENDS

By using sizeof DOCKINGDATA in GetPrivateProfileStruct and WritePrivateProfileStruct you actually touch the last 4 parameters. Agree? Use 40 instead (see attached modified Add-In)

b)You don't need to copy the structure. The structure is being updated in real time by WinAsm:
;invoke GetWindowLong,hAddIn,0
;invoke MoveMemory,offset AddInDockData,eax,sizeof DOCKINGDATA

I hope this helps

akypian
Posted on 2003-11-06 00:29:13 by akyprian



Hi!

1.I do not see any Oops! Are you using V2.0.0.2b? What do you see? Any other users have any problem?

I'm using version 2.0.0.2b, but I've tried 2.0.0.2 too and I got the same bug. I have Win98.
I'll post a screen capture next time...
Anyway, the "oops" is the docking window getting drawn twice, one next to the other. Only one of the two windows is real, the other seems to be garbage. Forcing WinAsm to redraw that part of the screen erases the "ghost" window. One more thing: I tried it only when no project as loaded... I didn't try under other conditions so I don't know if it's meaningful.

2.You are doing 2 major mistakes:

a)The structure is

DOCKINGDATA STRUCT
lpCaption DWORD ?
fDockedTo DWORD ? ;1=left,2=right,3=top,4=bottom,5=NoDock
NoDock POSANDSIZE <?>
DockTopHeight DWORD ?
DockBottomHeight DWORD ?
DockLeftWidth DWORD ?
DockRightWidth DWORD ?

;Do not touch these!
reserved1 DWORD ?
reserved2 DWORD ?
reserved3 RECT <?>
reserved4 POINT <?>
DOCKINGDATA ENDS

By using sizeof DOCKINGDATA in GetPrivateProfileStruct and WritePrivateProfileStruct you actually touch the last 4 parameters. Agree? Use 40 instead (see attached modified Add-In)

Doh! :o
(I didn't think of that :grin: )
So like I first thought, the bug was mine after all :)

b)You don't need to copy the structure. The structure is being updated in real time by WinAsm:
;invoke GetWindowLong,hAddIn,0
;invoke MoveMemory,offset AddInDockData,eax,sizeof DOCKINGDATA

I hope this helps

akypian

You mean WinAsm doesn't copy the data somewhere else in memory? In that case, it's good to know that I can't store the structure in the stack in future versions of the addin...
So I don't need to call GetWindowLong, because AddInDockData in my .data section already has this information all the time (correct me if I got it wrong).

I'll try all this and see how it worked.
Thanks! :alright:
Posted on 2003-11-06 16:16:06 by QvasiModo

You mean WinAsm doesn't copy the data somewhere else in memory? In that case, it's good to know that I can't store the structure in the stack in future versions of the addin...
So I don't need to call GetWindowLong, because AddInDockData in my .data section already has this information all the time (correct me if I got it wrong).


EXACTLY

akyprian
Posted on 2003-11-07 08:21:35 by akyprian