Solved

Dialogs & WS_VISIBLE

Posted on 1998-10-10
4
721 Views
Last Modified: 2013-12-03
I am trying to make a dialog NOT visible , but no trick works . Removing the WS_VISIBLE from the resource file does nothing , processing WM_INITDIALOG and ShowWindow or SetWindowLong do nothing also .
Please help.
0
Comment
Question by:WxW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 20 total points
ID: 1415163
First of all, don't use the styles, use a call to ShowWindow().  2nd of all, do it at the right time.  You cannot do it from onInitDialog() (you can, but it does no good)  The diealog is invisible at that time anyways, later on it is shown so you must "hit" it later on.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1415164
Opps, above I thought you were using MFC, but I'mm not sure why.  OnInitDialog() should just be WM_INITDIALOG.

I'm not sure when you want it visible and when not, but it sounds like you want to create it invisible, right?  In that case, I would "hook" the WM_WINDOWPOSCHANGING message.  In there get a hold of the WINDOWPOS structure and then set the SWP_HIDEWINDOW bit flag of the flags member.  That will make the window invisible

Of course you will need some sort of "switch" to determine when your code should set this bit flag and when it should not.  Otherwise, the window will never be visible.

Ask if you have questions.
0
 
LVL 6

Author Comment

by:WxW
ID: 1415165
I already had in mind the "switch" trick , but I could not think that WM_WINDOWPOSCHANGING should be trapped . Why the hell Windows does not take the style from the resource ?
Thanks nietod .
0
 
LVL 22

Expert Comment

by:nietod
ID: 1415166
It does use the style in the resource.  It creates the dialog as an invisible window, just like you requested.  However, later on (sometime after WM_INITDIALOG) it displays the dialog.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question