-
April 26th, 2014, 06:06 PM
#1
Arg! I cannot hide this MFC to save my life!
http://read.pudn.com/downloads125/so...mple.cpp__.htm
That is the code.. I have tried ALL sorts of stuff... For HOURS...
Please help.
Oddly enough I have commented out CreateWindow, and the window still gets created. Same with ShowWindow.
Anyone know why?
Thanks!
-
April 26th, 2014, 06:15 PM
#2
Re: Arg! I cannot hide this MFC to save my life!
What? There's no MFC in your app, and even if there were, it's not something you hide. Explain your problem in more detail.
-
April 26th, 2014, 06:17 PM
#3
Re: Arg! I cannot hide this MFC to save my life!
Yeah.. I don't quite understand.. I just want to make the window invisible to the user.
Either moving the window position, or etc.. I don't care.
Thanks!
-
April 26th, 2014, 06:22 PM
#4
Re: Arg! I cannot hide this MFC to save my life!
I have modified the sample to go straight to the timer and all this stuff I needed.
The LAST thing I thought would be SO SIMPLE would be... Hiding a Window without using another program....
Sigh!
Without the taskbar!
-
April 26th, 2014, 06:23 PM
#5
Re: Arg! I cannot hide this MFC to save my life!
Originally Posted by orokusaki
Yeah.. I don't quite understand.. I just want to make the window invisible to the user.
Either moving the window position, or etc.. I don't care.
Thanks!
You're calling ShowWindow. Read up on it and the arguments it takes.
-
April 26th, 2014, 06:35 PM
#6
Re: Arg! I cannot hide this MFC to save my life!
I did.. I changed it to.. and used it twice.. (from some other thread). Still shows a window. I also tried ShowWindow( hWnd, 0 );
The window shows even if I comment out ShowWindow, Update Window...
if( !hWnd )
{
ShowWindow( hWnd, SW_HIDE );
ShowWindow( hWnd, SW_HIDE );
return FALSE;
}
ShowWindow( hWnd, SW_HIDE );
ShowWindow( hWnd, SW_HIDE );
UpdateWindow( hWnd );
return TRUE;
Still no go...
-
April 26th, 2014, 06:38 PM
#7
Re: Arg! I cannot hide this MFC to save my life!
You're doing that on line 112?
Why do you have a test for !hwnd?
Why are you doing it from another thread?
Other than that, I guess you'll have to step through with the debugger and see which line is causing it to display.
-
April 26th, 2014, 07:06 PM
#8
Re: Arg! I cannot hide this MFC to save my life!
DialogBox( hInstance, ( LPCTSTR )IDD_SAMPLE1_DIALOG, NULL, ( DLGPROC )EM2800PropProc );
That line seems to show the DialogBox....
It runs after the ShowWindow and CreateWindow lines... the ones I commented out...??
Last edited by orokusaki; April 26th, 2014 at 07:12 PM.
-
April 27th, 2014, 04:36 AM
#9
Re: Arg! I cannot hide this MFC to save my life!
Originally Posted by orokusaki
DialogBox( hInstance, ( LPCTSTR )IDD_SAMPLE1_DIALOG, NULL, ( DLGPROC )EM2800PropProc );
That line seems to show the DialogBox....
It runs after the ShowWindow and CreateWindow lines... the ones I commented out...??
What "runs"?
What did you "comment out"?
Besides, you might want to show your code attached to your post here in the thread.
Please, read the Announcement: Before you post....
Victor Nijegorodov
-
April 27th, 2014, 06:16 AM
#10
Re: Arg! I cannot hide this MFC to save my life!
Originally Posted by orokusaki
DialogBox( hInstance, ( LPCTSTR )IDD_SAMPLE1_DIALOG, NULL, ( DLGPROC )EM2800PropProc );
That line seems to show the DialogBox....
It runs after the ShowWindow and CreateWindow lines... the ones I commented out...??
That's what DialogBox does. The Dialog box and the window you create with CreateWindow are different windows.
-
April 28th, 2014, 04:18 AM
#11
Re: Arg! I cannot hide this MFC to save my life!
Originally Posted by orokusaki
Oddly enough I have commented out CreateWindow, and the window still gets created. Same with ShowWindow.
Anyone know why?
There are two windows that your code creates. Commenting out CreateWindow just prevents the first window from creation. Apparently you're talking about the other window, the dialog. If you are, then you seem do nothing to hide the one.
Best regards,
Igor
-
April 28th, 2014, 06:44 AM
#12
Re: Arg! I cannot hide this MFC to save my life!
Code:
DWORD dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);
::SetWindowLong(hWnd, GWL_STYLE, dwStyle & ~WM_VISIBLE);
-
April 28th, 2014, 07:56 AM
#13
Re: Arg! I cannot hide this MFC to save my life!
This is because (in theory) MFC is meant to be seen baby!
ahoodin
To keep the plot moving, that's why.
-
April 29th, 2014, 06:32 AM
#14
Re: Arg! I cannot hide this MFC to save my life!
Originally Posted by ahoodin
This is because (in theory) MFC is meant to be seen baby!
theory has nothing to do here, and the statement is wrong.
there are plenty of usage cases where you might use MFC but not have a UI.
Typoically thse would be implemented as COM, Webservice, Service and don't usually need a UI directly.
Or where the UI is just a console.
But yes, seeing the vast majority of MFC classes is dealing with GUI controls, generally speaking an MFC app would have a visible GUI.
-
April 29th, 2014, 07:04 AM
#15
Re: Arg! I cannot hide this MFC to save my life!
The only place the OP is using MFC is in the misleading thread title. There's none in his code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|