Hiding the dialog window in my MFC application.

I am working on a dialog based application with MFC wizard. My requirement is to hide the dialog window upon accepting
a command line option (with_gui) . First of all I would like to know whether this is possible ? If so, please guide me to hide
the dialog box (the one which comes immidiately after running the project) and opening a dos window. Hence, my applicaition
should be able to run in both GUI and CLI mode.

For more information Invokation will be something like thi
1.
c:\> myapp without_gu
The application will run in the same console window printing all the tool messages in the same consol
2.)
c:\> myapp with_gu
A dialog box will popup and user will work on this dialog box further



0
anonymous (74723)
3/3/2004 4:36:07 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
903 Views

Similar Articles

[PageSpeed] 46

ShoiwWindow(SW_HIDE)
			joe

On Tue, 2 Mar 2004 20:36:07 -0800, Shrinivas <anonymous@discussions.microsoft.com> wrote:

>I am working on a dialog based application with MFC wizard. My requirement is to hide the dialog window upon accepting 
>a command line option (with_gui) . First of all I would like to know whether this is possible ? If so, please guide me to hide 
>the dialog box (the one which comes immidiately after running the project) and opening a dos window. Hence, my applicaition 
>should be able to run in both GUI and CLI mode. 
>
>For more information Invokation will be something like this
>1.)
>c:\> myapp without_gui
>The application will run in the same console window printing all the tool messages in the same console
>2.) 
>c:\> myapp with_gui
>A dialog box will popup and user will work on this dialog box further.
>
>
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
3/3/2004 4:55:26 AM
You can hide a modeless dialog using ShowWindow. A dialog app is modal by
default. However you can convert it to  modeless as shown in the following
tip from Bob Moore's site:

http://www.mooremvp.freeserve.co.uk/Win32/framed_tip026.htm

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Shrinivas" <anonymous@discussions.microsoft.com> wrote in message
news:A403E929-3408-4947-B0F3-0DD280F57EB5@microsoft.com...
> I am working on a dialog based application with MFC wizard. My requirement
is to hide the dialog window upon accepting
> a command line option (with_gui) . First of all I would like to know
whether this is possible ? If so, please guide me to hide
> the dialog box (the one which comes immidiately after running the project)
and opening a dos window. Hence, my applicaition
> should be able to run in both GUI and CLI mode.
>
> For more information Invokation will be something like this
> 1.)
> c:\> myapp without_gui
> The application will run in the same console window printing all the tool
messages in the same console
> 2.)
> c:\> myapp with_gui
> A dialog box will popup and user will work on this dialog box further.
>
>
>
>


0
ajaykalra (6842)
3/3/2004 5:17:52 AM
On Tue, 2 Mar 2004 21:17:52 -0800, "Ajay Kalra" <ajaykalra@yahoo.com>
wrote:

>http://www.mooremvp.freeserve.co.uk/Win32/framed_tip026.htm

Oh, I've moved, by the way :

>http://bobmoore.mvps.org/Win32/framed_tip026.htm

Part of the family now :-)

On the whole though, I'm not sure the original poster will be well
served by this. I have seen sample code for bi-form console/gui
applications before, but can't for the life of me remember where.

0
bobm (116)
3/3/2004 1:45:15 PM
Reply:

Similar Artilces:

CRM Application Security
I was hoping for advice from the community regarding information about how CRM manages application security with Active Directory. A customer is currently running a Windows NT Domain and Active Directory to support Exchange 2003, with an external trust to access mailboxes from Windows NT; primary user accounts are in Windows NT. If CRM was deployed first, and users were later migrated to Active Directory whereby SID-History was used to maintain the original SID, how would CRM behave with this scenario? I guess what I am looking for is an understanding of the SID touchpoints, how CRM ...

Not able to get items from Outlook Inbox from Windows Service using VB.NET
I have a Windows Service which is setup and running properly, well, at least it execute my RunThrougInbox method when it is supposed to be. The problem I am having though is that when my RunThroughInbox method is executing, it seems to stop when it gets to the "PROBLEM ON THIS NEXT LINE:" line. I am writing each step of the way to the event viewer window and my logs are mysteriously stopping. Does anyone have any suggestions? Thanks Here is a portion of my code to help with any resolutions or ideas. Protected Overrides Sub OnStart(ByVal args() As String) Dim cbTimer As...

Possible to take a SNAPSHOT of a common dialog box?
Hi, I wrote a generic function that takes a "CDialog" type input as a parameter. My function then does a "Create()" on it (making a modeless dialog), leaving off the WS_VISIBLE style so that its not visible on the screen. It then sends it a WM_PRINT message.. the result is that I am able to take a "snapshot" of a dialog into a HBITMAP object without the dialog ever appearing on the screen. This works for CDialog and CPropertySheet, etc. Basically any object that responds to a WM_PRINT would work. Then I tried to do the same with a CFileDialog. Well, obviou...

Hiding "0" values in pivot table
In a worksheet I have a listing of stock records with ItemNumber, Date, StockLocation and NumberOnStock. When I make simple Pivot Table with ItemNumber and StockLocation as rows and select a Sum of "NumberOnStock" I would like to hide rows where the sum is "0". But this does not seem to be possible. Tried to follow the guidelines in the Microsoft article: http://office.microsoft.com/en-us/assistance/HP051998791033.aspx#Hide%20zero%20values%20in%20a%20PivotTable%20report But no luck :-( Mogens You could use conditional formatting on these cells - highlight the cells,...

Relationships Window '11' ??
Okay I'm not finding this any where. Access 2003 Relationships Window, one of the relationships is 11 (eleven). What does that mean? Edit Relationships shows the exact same settings as 1 : 1. Rick Just a guess ... any chance the two tables are squeezed quite close together? What happens if you pull them a bit further apart from each other? Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute end...

Hiding formuals in cells question
Hi. I was wondering if there was a way to hide the formulas in cells without protecting the sheet. I am making something for other teachers at my school and I want to hide the formulas so they won't mess anything up on the spreadsheet. Any help would be greatly appreciated. Thanks! Hi not without protecting the sheet but why is this a problem for you? -- Regards Frank Kabel Frankfurt, Germany "JP" <JP@discussions.microsoft.com> schrieb im Newsbeitrag news:ABFE07BF-6087-4E24-814A-03AF8863A633@microsoft.com... > Hi. I was wondering if there was a way to hide the fo...

customization form dialog
I need custom the "close opportunity form dialog", this form is visible when you close an opportunity. But i don't found it. somebody, please tell me where i found this form?, or is possible change that? Hi, Miguel, Are you referring to the form that opens if you open an opportunity, click Actions at the top of that form, and then click Close Opportunity? You cannot customize the Close Opportunity (opportunityclose) entity. You can find this entity by doing the following: In the Navigation Pane, click Settings, click Customization, and then click Customize Entities. A lis...

Multiple SOP Windows
Is there a setting in version 7.5 software setup that allows one user to have more than one SOP window/document open at one time. If not this is simply very poor design. Without this ability it is very cumbersome to handle say periodic customer inquiries and at the same time work at another task such as new order entry. One should simply be able to flip from one window/document to another. -- Best Regards George You can launch another GP session; although, that will use another user license. For inquiries, could a person not use the Sales Document Inquiry to look up information? ...

hide my name
When replying to an email or creating one from scratch how do i hide my name in the "from" field...thx fred <fdbjrgetridofthis@wowway.com> wrote: > When replying to an email or creating one from scratch how do i hide > my name in the "from" field...thx Are you saying you want the reply to be anonymous? -- Brian Tillman [MVP-Outlook] no, I don't mind if my email is revealed.. just my name. I have tried by removing it from the "User Name:" field in the email account but it continues to show up. I have also removed from the header informati...

OnIdle in modal dialog
Hi guys, I have a button named 'Update' in my dialog and its handler communicates with electronic device via serial port. So button should be enabled only in Online status. It would be convenient if following code can be executed automatically when dialog is idle(?). Is it possible? Thanks Bob void CMyDlg::OnIdle() { // BOOL online is a member of CMyDlg online = IsOnline() ? TRUE: FALSE; UpdateControls(); } For a modal dialog, you can handle WM_KICKIDLE instead of OnIdle. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Bob Lee" <bob.lee@vmsl.co.nz> wrote in...

Publisher starts with Windows Installer always
I have a customer who installed MS Publisher 2000 as the local administrator. The local administrator can launch MS Publisher fine. But, when she logs in as her Domain Username, it continually starts by launching the Mini Windows Installer for Publisher and looks for DATA2 location. Even if she gives the DATA2 location and goes into Publisher THE NEXT time it does it all again....starts mini install and asks for DATA2. She points to it again and she can get to Publisher. This always happens. I'm perplexed because the administrator profile does not have this issue. I even ...

Errors
I get the following problems in Outlook 2007 Professional new installation with Windows 7 ultimate O/S - 1) When I try to import a Personal folder from another .pst file of same Outlook 2007 version it gives me an error "The Messaging interface has returned an unknown error. If the problem persists restart Outlook". This error never goes off even after restart. 2) Trying to add new Outlook data file through Data File Management after selecting type of storage for new outlook data file as Office Outlook Personal Folders file and selecting the specific .pst file it g...

Hiding and Un-Hiding Data fields
I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then...

How do I hide gaps in an Excel 2007 chart?
I have a bar chart that is showing gaps and i don't want them. The select data > hidden and empty cell button does not give an option to hide gaps. I think by default they are hidden but if you even click on this to see what it does the gaps are shown and no way to turn off. Hi, If you hide the actual rows then with the Plot visible cells only setting on the gaps will be removed. In xl2007 the setting is on the Select Data dialog, Hidden/empty cells button. Cheers Andy Waynesch wrote: > I have a bar chart that is showing gaps and i don't want them. The s...

Portability to all versions of Windows
I am writing an VC++ 6, MFC app that uses standard listviews, dialogs, DaoRecordset connecting to an Access database and Crystal Reports. I know that 2000 and XP are very similar and portability should not be an issue, but what about 98 and ME? Are there any issues that would prevent the app runing under 98 and ME? William Gower wrote: > I am writing an VC++ 6, MFC app that uses standard listviews, dialogs, > DaoRecordset connecting to an Access database and Crystal Reports. I know > that 2000 and XP are very similar and portability should not be an issue, > but what about 98...

how to draw static text in a dialog
I creat a dilog and want to display some lines in the static text of the dialog . this is code: CWnd *pWnd = (CWnd*)GetDlgItem(IDC_mystatictext); CDC* pDC= CWnd::GetDC(); pDC->MoveTo(0, 0); pDC->LineTo(600, 400); but it just display in the dialog and cannot display in the static text! I just a newer one to study vc,thanks for yous help. You dont have to draw anything. Simply call SetWindowText on it: CWnd *pWnd = GetDlgItem(IDC_mystatictext); ASSERT_VALID(pWnd); pWnd->SetWindowText(_T("SomeText")); --- Ajay liuerbin2000@163.com wrote: > I creat a dilog and want t...

windows expplorer "search" is useless on my T43... help!
I have a T43 ThinkPad with Windows XP. For years I have used Windows Explorer "Search" with good results. Recently (or maybe not-so-recent) the search engine on it was "updated" to a super-thingy that strives to search everything including file content. Well, it has done that on RARE occasions, but only for limited things like in specific directories, or something weird like ........documents\setting\admin... or the like where nothing of interest exists. When I try to force this thing ("windows\search\desktop") to search the whole c:\ drive, it balks and s...

Hide images when Hiding Rows
I have inserted images into cells, but when I hide the column the images are not hidden with that column, they just get squished between the two cells next to the hidden cell. Is there a setting or way to tie the image to that cell so that it hides/unhides appropriately with the row? -- kurt ------------------------------------------------------------------------ kurt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=35686 View this thread: http://www.excelforum.com/showthread.php?threadid=554712 Kurt You cannot insert an image into a cell. You can overlay ...

Outlook 2000 and Windows XP
I recently purchased a PC running Windows XP. I installed my Microsoft Office 2000 software and set up Outlook including my e-mail accounts. On the "servers" tab I have added my password and checked "remember my password" however, EVERY TIME I send/receive I am promted for my password. If I'm not there to type it in, I get an error message and no mail. Is this a compatibility issue with XP and Outlook 2000? It's infuriating... any advice? Have you installed all of the SPs for Office? --� Milly Staples [MVP - Outlook] Post all replies to the group ...

C++ VS 2005 Application works in Debug, not in Release Mode
I have a C++ application which runs in debug, though not release, mode. The application opens a dialog box, which generates an error when run in release mode. It instantiates correctly, but the OnInitDialog() method throws an error. The dialog itself is simple, it has only a progress bar and a bitmap. When I look at modules which get loaded, I see that comctl32.dl gets loaded twice, once from the Windows\System32 directory, once from the Windows\WinSxS\x86_Microsoft... directory. Could this be the problem? My code in the OnInitDialog() method now looks like this: MyDlg::OnInitDialog...

Hiding a worksheet #3
I want to hide a worksheet. So, I went to the format menu and the "worksheet" option is grayed out. Why? And, how do I "ungray" it. Hi is your worksheet protected ? -- Regards Frank Kabel Frankfurt, Germany llong wrote: > I want to hide a worksheet. So, I went to the format menu and the > "worksheet" option is grayed out. Why? And, how do I "ungray" it. I think Frank meant to ask about the Workbook--not the worksheet. (Check under Tools|protection|Protect workbook or Unprotect workbook) My question is: Is there another sheet in the w...

Storage Groups In Windows SBS 2003 R2 Premium
As I have writen above, I have Windows SBS 2003R2 Premium and would like to make 2 storage groups and then an mailbox storage in the second storage in the exchange, but I get an error massage: "The Storage group already contains the maximum number of storage allowed" ID No. c1034a7a. How do I get around that problem? Is it possible to sent from multiple domains that is running on the Exchange?? I thank you for the help! FlashBang wrote: > As I have writen above, I have Windows SBS 2003R2 Premium and would > like to make 2 storage groups and then an mailbox storage in t...

Sort Window Size
My company recently upgraded to Windows7 and Office 2007. When I use the sort command in Excel, the size of the sort window increases with each use of the command. I have to grab the edge of the popup window and resize it in order to see the work sheet. Is this a known problem with this software combination, or an installation problem? -- EWJJET My office just upgraded to Office 2007 (still Windows XP) and I've got the same problem with the sort window growing. I'm sorry I don't have an answer for you - but perhaps you've found out what the issue is by now? I...

cannot see my dialog/forms.
By accident i excluded a file or something from my project, now i dont see my gui anymore,. i try to include the res files, but in the resource viewer i dont see the dialofg box nomore. the appl. still compiles and runs, what do i have to do to get the gui back? thanx N. Karademir Smart Software wrote: > By accident i excluded a file or something from my project, now i dont see > my gui anymore,. > i try to include the res files, but in the resource viewer i dont see the > dialofg box nomore. > the appl. still compiles and runs, > > what do i have to do to get the ...

closing windows
Hi I'm using Office XP Pro under windows 2000. With multiple Excel (2002) windows open, clicking on the Close button closes all the windows while clicking on the close window button only closes that window. That seems reasonable, but in Word, clicking on the Close button only closes that wondow. Is there some setting to customise this? Thanks Brad I don't think so. Brad wrote: > > Hi > > I'm using Office XP Pro under windows 2000. With multiple > Excel (2002) windows open, clicking on the Close button > closes all the windows while clicking on the cl...