Is there any reason why you shouldn't use CreateWindow in a DLL?
I've got an application that calls a function in a custom DLL from its
wndproc. In the DLL, I am creating a window using CreateWindow with
WS_POPUPWINDOW | WS_CAPTION | WS_CHILD, and displaying it modally (i.e.
executing a message pump in the DLL's function).
This works almost fine, i.e. the window displays and closes again and is
like a child popup window should be, but the window does 'jump around' a
bit, i.e. when you try to select the background (main app's) window, then
click on the caption of the child window, it does a little hop to another
area of the screen. Not far, but it's definitely more than the negligible
amount of dragging associated with the clicking. The DLL only registers its
wndclassex on the first call to it, after that, it just uses the same one. I
am also calling DestroyWindow on the child window before exiting the DLL
function.
I did rethink about the design of the app and decided that using
CreateDialog with a dialog resource might be better. (Also to that, is there
any reference on the commands used in the .rc file for the dialog resource?)
But I'm hesitant to, for fear the same thing may happen if I don't know
what's causing it, whereas if I can isolate the problem I can make sure it's
not due to the fact that it's in a DLL.
Thanks
Steve Alpert - 15 Nov 2004 17:40 GMT
> Is there any reason why you shouldn't use CreateWindow in a DLL?
> I've got an application that calls a function in a custom DLL from its
[quoted text clipped - 10 lines]
> am also calling DestroyWindow on the child window before exiting the DLL
> function.
CreateWindow is just fine in a DLL. Perhaps you have other code in your
DLL that responds to WM_SIZE or WM_MOVE that is confusing client
coordinates with window coordinates?
/steveA

Signature
Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org)
and spaces
Bonj - 16 Nov 2004 08:49 GMT
nope, no other messages are handled, other than WM_CLOSE.
> > Is there any reason why you shouldn't use CreateWindow in a DLL?
> > I've got an application that calls a function in a custom DLL from its
[quoted text clipped - 15 lines]
>
> /steveA
Norman Bullen - 19 Nov 2004 02:10 GMT
> Is there any reason why you shouldn't use CreateWindow in a DLL?
> I've got an application that calls a function in a custom DLL from its
[quoted text clipped - 18 lines]
>
> Thanks
A window can't have both WS_POPUP and WS_CHILD styles.
You probably want only WS_POPUP since you have also specified WS_CAPTION.
Norm

Signature
--
To reply, change domain to an adult feline.