?
Solved

Dialogs & WS_VISIBLE

Posted on 1998-10-10
4
Medium Priority
?
725 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 80 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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 extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

765 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