Solved

Dialogs & WS_VISIBLE

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Enable Clear Text in Win 8.1 7 46
Insert filename column as column a 18 76
How to copy an image file into clipboard C/C++? 1 199
GUI: DIalog Stacking and Popping in MS C++ 4 82
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 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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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