Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2004

Tip: Looking for answers? Try searching our database.

window jumps around

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bonj - 15 Nov 2004 00:23 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
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.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.