Solved

Dialogs & WS_VISIBLE

Posted on 1998-10-10
4
714 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
  • 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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.…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now