? Maximized detection

    Hi,

    I've got a dialog that I have set up with a menubar and statusbar.  I
have made it so that the user can show or hide either.  What I need now is
to detect if the dialog is maximized when the user shows/hides either bar so
that I can adjust the dialog to still be maximized.


thanks.

--
Alec S.
alec @ synetech . cjb . net




0
Alec
2/29/2004 4:27:30 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
743 Views

Similar Articles

[PageSpeed] 52

How about something like this...

BOOL IsMaximized( CWnd* pWnd )
{
    ASSERT( pWnd && ::IsWindow( pWnd->GetSafeHwnd() ) );
    WINDOWPLACEMENT wp;
    pWnd->GetWindowPlacement( &wp );
    return (wp.showCmd == SW_SHOWMAXIMIZED) ? TRUE:FALSE;
}


HTH
-- 
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.


"Alec S." <a@a.com> wrote in message
news:%23ybsVxn$DHA.684@tk2msftngp13.phx.gbl...
>     Hi,
>
>     I've got a dialog that I have set up with a menubar and statusbar.  I
> have made it so that the user can show or hide either.  What I need now is
> to detect if the dialog is maximized when the user shows/hides either bar
so
> that I can adjust the dialog to still be maximized.
>
>
> thanks.
>
> --
> Alec S.
> alec @ synetech . cjb . net
>
>
>
>


0
2/29/2004 5:44:27 AM
    Yes, that works great.  Thanks.  :)


--
Alec S.
alec @ synetech . cjb . net



"Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote in message
news:RpSdnehin7BU5tzdRVn-jw@comcast.com...
> How about something like this...
>
> BOOL IsMaximized( CWnd* pWnd )
> {
>     ASSERT( pWnd && ::IsWindow( pWnd->GetSafeHwnd() ) );
>     WINDOWPLACEMENT wp;
>     pWnd->GetWindowPlacement( &wp );
>     return (wp.showCmd == SW_SHOWMAXIMIZED) ? TRUE:FALSE;
> }
>
>
> HTH
> --
> ============
> Frank Hickman
> NobleSoft, Inc.
> ============
> Replace the _nosp@m_ with @ to reply.
>
>
> "Alec S." <a@a.com> wrote in message
> news:%23ybsVxn$DHA.684@tk2msftngp13.phx.gbl...
> >     Hi,
> >
> >     I've got a dialog that I have set up with a menubar and statusbar.
I
> > have made it so that the user can show or hide either.  What I need now
is
> > to detect if the dialog is maximized when the user shows/hides either
bar
> so
> > that I can adjust the dialog to still be maximized.
> >
> >
> > thanks.
> >
> > --
> > Alec S.
> > alec @ synetech . cjb . net
> >
> >
> >
> >
>
>


0
Alec
2/29/2004 6:03:03 AM
Wouldn't using CWnd::IsZoomed give the same result?
				joe

On Sun, 29 Feb 2004 00:44:27 -0500, "Frank Hickman" <fhickman_nosp@m_noblesoft.com> wrote:

>How about something like this...
>
>BOOL IsMaximized( CWnd* pWnd )
>{
>    ASSERT( pWnd && ::IsWindow( pWnd->GetSafeHwnd() ) );
>    WINDOWPLACEMENT wp;
>    pWnd->GetWindowPlacement( &wp );
>    return (wp.showCmd == SW_SHOWMAXIMIZED) ? TRUE:FALSE;
>}
>
>
>HTH

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)
2/29/2004 10:24:03 PM
    Probably, thanks.

--
Alec S.
alec @ synetech . cjb . net


e
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:hjp440dvjvmskamkakom0i0hb9j6tkga0s@4ax.com...
> Wouldn't using CWnd::IsZoomed give the same result?
> joe
>
> On Sun, 29 Feb 2004 00:44:27 -0500, "Frank Hickman"
<fhickman_nosp@m_noblesoft.com> wrote:
>
> >How about something like this...
> >
> >BOOL IsMaximized( CWnd* pWnd )
> >{
> >    ASSERT( pWnd && ::IsWindow( pWnd->GetSafeHwnd() ) );
> >    WINDOWPLACEMENT wp;
> >    pWnd->GetWindowPlacement( &wp );
> >    return (wp.showCmd == SW_SHOWMAXIMIZED) ? TRUE:FALSE;
> >}
> >
> >
> >HTH
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
Alec
2/29/2004 11:18:16 PM
Why yes, yes it would...I knew there was a function but I searched for
IsMaximized, my bad, nice catch Joe.

--
Frank

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:hjp440dvjvmskamkakom0i0hb9j6tkga0s@4ax.com...
> Wouldn't using CWnd::IsZoomed give the same result?
> joe
>
> On Sun, 29 Feb 2004 00:44:27 -0500, "Frank Hickman"
<fhickman_nosp@m_noblesoft.com> wrote:
>
> >How about something like this...
> >
> >BOOL IsMaximized( CWnd* pWnd )
> >{
> >    ASSERT( pWnd && ::IsWindow( pWnd->GetSafeHwnd() ) );
> >    WINDOWPLACEMENT wp;
> >    pWnd->GetWindowPlacement( &wp );
> >    return (wp.showCmd == SW_SHOWMAXIMIZED) ? TRUE:FALSE;
> >}
> >
> >
> >HTH
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
2/29/2004 11:50:29 PM
Reply:

Similar Artilces:

Maximized vs minimized
I have a macro that copies data from disc drive A: and copies it to th current open spreadsheet. All works fine, except when it's done i minimizes the window. What code could I add to maximize the active window? Something like: ActiveWindow.WindowState = ???????? Thank You, Michae -- Message posted from http://www.ExcelForum.com Michael Try, Application.WindowState = xlMaximized Cheers John "daniels012 >" <<daniels012.1b7dva@excelforum-nospam.com> wrote in message news:daniels012.1b7dva@excelforum-nospam.com... > I have a macro that copies data from di...

Maximizing MainFrame
Hi everyone, I use VC++ 6.0. I have an MDI application that I want to be able to dynamiaclly maximize in such a way that user would not be able to get to the desktop. My goals are: 1. MainFrame should be maximized. 2. Minimize and Restore buttons should be either greyed out or removed. 3. User should not be able to move the application window. 4. The [x] close button in the top right corner should be visible. I have to use SetWindowLong() as oppose to Create() because this all has to happen dynamically many times in application's lifetime. My goal 1 ("maximized" is easy to achi...

Detect if MDB has autoexec or a startup form
Does anyone know of way to detect if a MDB has a autoexec or startup form in use without openned the MDB using access.exe. Many thanks in advance Function StartUp(PathToMDB As String) As String On Error GoTo EH Dim db As DAO.Database Dim strMessage As String Dim strStartForm As String If Len(Dir(PathToMDB)) > 0 Then Set db = OpenDatabase(PathToMDB) strStartForm = db.Properties("StartUpForm") If Len(strStartForm) > 0 Then strMessage = PathToMDB & " specifies " & _ strStartForm & " for startup." &...

How can I keep a maximized form maximized?
Hi All, I have a form I want maximized. I added DoCmd.Maximize to the form Open event. I set the property sheet for no min max buttos, but a minimize button still shows up next to the close button (which I have to have. Is there a majic spell I can use in VB to hide the min button? Second to making it go away, can I trap it and stop it from happening? Thanks, Max Hi Max, Are you sure you set the option minimize and maximize to none because if you did you shouldn't see neither option. Reading your post it looks like you have opted for only showing the minimize op...

MultiWorkbook Change Event Detection / Spell Checker
Excel 2003 or 2007. Looking to be able to force spell checking whenever any cell content is is changed. I've been successful on a single workbooks by adding Spell Check execution on Worksheet_Change. I'm hoping to take this one step further - make it an 'Add-In' so the check will run for any workbook. It looks like the Worksheet_Change event only triggers for the host workbook so an 'Add-in' will not do the job. Any suggestions to force spell checking on a change for any workbook/worksheet I modifiy? TIA, - Pat The way I would go about this i...

How to detect changes in a column?
If I have a table with sales forecast data (columns) like Customer, Amount and Status, what would be the best way to track changes in this table so I can compare my forecast week after week? -- inomata ------------------------------------------------------------------------ inomata's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=18938 View this thread: http://www.excelforum.com/showthread.php?threadid=493571 ...

Report is maximizing weird
I setup my report previews so that they maximize on load. I had it working fine but I must have done something wrong because now the form Maximizes funny. It fills up the database window but you can still see the caption. It seems Access thinks its maximized because I can't maximize it any further by hitting the maximize button, yet when I minimize it then maximize it, it correts itself. This causes a problem because right now, the page selector at the bottom is hidden because it isn't maximized correctly and I have to min/max in order to see it. Thanks, -- TIA On Report...

detect and repair
my outlook 2002 had some hyperlink problems which were corrected when i used the 'detect and repair' option in help. now i have lost my addresses and all the e-mail that was in my inbox. How do i recover these items? Check this page for all you need to know: http://www.slipstick.com/config/backup.htm -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP http://home.hawaii.rr.com/schorr **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Mark Conner" <mdconner@prodigy.net> wrote ...

Maximizer
I am trying to send emails with Maximizer 7 but Outlook keeps giving me a 509 syntax error - can anyone help? ...

Duplicate detection detecting inactive records?
Is there any way to configure duplicate detection to not look at inactive records? I can't find any way to set this on the rules. Thank you! ...

How to Detect and prevent CD burn
HI, How can i stop to CD burn of any file from my system to CD.How to detect the event of CD burn and how can i stop CD burn.Basically i want to secure my file from CD burn. plz reply soon. regds vinay sheel vinays@aditi.com Vinay wrote: > HI, > How can i stop to CD burn of any file from my system to CD.How to detect the > event of CD burn and how can i stop CD burn.Basically i want to secure my > file from CD burn. You can restrict access to a file only to a certain users through NT/win200 access privileges. You can encrypt a file and therefore restrict access to a file on...

Resize when maximize
I have dialog based application with textbox and button i need when maximize the dialog the textbox automatically resized in dialog....i hope i explained what i need This might help you: http://www.codeproject.com/dialog/ResizableLib.asp Tom "Raed Sawalha" <RaedSawalha@discussions.microsoft.com> wrote in message news:74A27EF5-FC27-4B96-B306-7F4FC3E26175@microsoft.com... >I have dialog based application with textbox and button i need when >maximize > the dialog the textbox automatically resized in dialog....i hope i > explained > what i need ...

Detect Valid Full backup
To detect if there is a valid Full backup exist, before starting a log backup I check of the LastBackupDate is filled. Sometime this give the following error. Error.Message : BACKUP LOG cannot be performed because there is no current database backup. BACKUP LOG is terminating abnormally. Error.Source : .Net SqlClient Data Provider Error.StackTrace : at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException) at Microsoft.SqlServer.Management.Common.ServerConnection.Execute...

How to detect unused Dist.List?
W2K3-SP1 | E2K3-SP1 Hi list... Does any one know, how to detect the Distribution List that has "N" days of inactivity (no inbound messages). A query (AD) or an Exchange report? On Mon, 14 Nov 2005 16:20:59 -0600, "OmarOZ7" <omaroz7@hotmail.com> wrote: >W2K3-SP1 | E2K3-SP1 >Hi list... >Does any one know, how to detect the Distribution List that has "N" days of >inactivity (no inbound messages). >A query (AD) or an Exchange report? > Message tracking? ...

maximizing Child View
HI all I am New user for VC, and i have just install MVS.NET. i try to make test application. and try MFC application. but wizard make child window not maximized . Will some one help me how to do it.? and how to hendel child window in MFC. Thanks. Amrit There is a ton of information including the answer to this question in this FAQ. http://ai.kaist.ac.kr/~ymkim/Program/mfc_faq.html Tom "Amrit" <cadd@wlink.com.np> wrote in message news:OYLUU11JJHA.920@TK2MSFTNGP05.phx.gbl... > HI all > I am New user for VC, and i have just install MVS.NET. > > i try to ...

Detect host of script calling a WSC
Hello, I have hundred of VBScripts and JScript scripts calling one WSC. The calling scripts are started with CScript or WScript as required in the current environment. The WSC starts helper VBScripts using shell.Run("scriptname.vbs"). Until WSH 5.6 these Scripts have been started with the same scripting host, that has been used from the outer scripts. Starting with WSH 5.7 the shell.Run() behaves different. It always use WScript as a host. I can not change the outer VBScripts for several reason, so I can't add a property to the WSC to pass the calling WScript...

Help Regarding memory leak detection.
Hi all, I am new to c++. I have written one c++ application. I want to detect memory leaks from my program. I tried with following code which i got from net. if(_CrtDumpMemoryLeaks() == TRUE) // reports no leak { printf("detected 1"); } int *foo = new int[4]; if(_CrtDumpMemoryLeaks() == TRUE)//reports a memory leak { printf("detected 2"); } delete[] foo; foo = NULL; if(_CrtDumpMemoryLeaks() == TRUE)// reports no leak { printf("detected 3&qu...

Child window is not displayed when parent window is maximized
Hi, I developing an ActiveX control, i have made Microsoft PPT.exe window as the child of my OCX window using SetParent function. Now when my IE window is minimized and maximized, then OCX window is refreshed but the PPT window which is child window of OCX window is not displayed on maximization of IE window. Same behavior is there when some other window overlaps the OCX window. Thanks Vibhor Mahajan ...

Detected memory leaks!
Hello, I have pointers in a CDocument-derived class that are initialized via CMemFile.Detach (). At program shutdown, how can I free the memory? -- Bill Swartz, PhD Voss Scientific Can you implement a destructor for you CDocument derived class and free the memory there? >-----Original Message----- >Hello, >I have pointers in a CDocument-derived class that are initialized via >CMemFile.Detach (). At program shutdown, how can I free the memory? > >-- >Bill Swartz, PhD >Voss Scientific > > > >. > ...

Lost 'Rules' and 'News' when I did 'Detect and Repair' How to recover?
In Outlook 2003, I did a 'Detect and Repair...' command and lost my downloaded email, Rules and Alerts and access to the news reader. Is it possible to recover my rules or am I doomed to typing them all back in one at a time? I used to access a news reader through Go\News. That menu item is no longer present. How can I recover it? --- Thanks! Richard Lewis Haggard You did a Detect & Repair with resetting your settings. This means you'll need to recreate your mail profile by going to Control Panel-> Mail. Once Outlook is configured you can open your pst-file (the file...

message, MDIChildFrame switch from Maximize->Restore Restore->Maximize
Hello, I need the information: if the user switch the MdiChildFrame from Restore-Mode to Maximize, with a titlebar-button or doubleclick on the titlebar. And the same back to restore-modus. The messages - SysCommand, - WindowPosChanged, - Size does not realy work. SysCommand don't has info about dblclick on titlebar ... and so on. Is there a message with this information. Thanks Frank Iversen What do you mean OnSysCommand doesn't have info about dblclick on the title bar. It sends a SC_MAXIMIZED to the MDIChildWnd. void CChildFrame::OnSysCommand(UINT nID,LPARAM lPa...

Heap corruption detected at 01670000 While Using CString
The Following is my function: CString CMem::GetALLData(UINT uStartStep, CString cRequests) { CString Package = "",sSteps, Buffer = ""; cs_Mem.Lock(); try{ int PLen = cRequests.GetLength(), Size = 0, Steps; if( Valid() && pMemStatus != NULL && pMediaBuff != NULL && PLen != 0){ for( int i = 0; i < PLen * 8; i++) { // if the request part is not in the list if( uStartStep + i > CurrentStep && uStartStep + i < CurrentStep + MemSize) { Steps = uStartStep + i - CurrentStep; //if( pMemRSTimes[Steps] &...

Question regarding detecting 404 Not Found
Hi asp.net 3.5 I see in the statics for mys ite that about 50% of the request are 404 not found. so I'm setting up a NoSuchPage.aspx which I want the user to be redirected to when such error occur. <customErrors mode="RemoteOnly" defaultRedirect="AppErrors.aspx"> <error statusCode="404" redirect="NoSuchPage.aspx"/> <error statusCode="403" redirect="NoAccessAllowed.aspx"/> </customErrors> In the NoSuchPage I want to write to the database which page the user requested. I'm unsu...

A looping condition was detected #2
Hi, I have a VPC which is a domain controller/exchange 2003 server/and is running sps 2007 beta. Everytime I try to send an email to aa SharePoint document library - the email bounces back and I get the following error in the application event log: non-delivery report with a status code of 5.3.5 was generated for recipient rfc822;NBC@Demow2k3.Demo.Activis.net (Message-ID <8FBD293AAD293347BBB03D0C430E733D5752@DemoW2k3.Demo.Activis.net>). Causes: A looping condition was detected. (The server is configured to route mail back to itself). If you have multiple SMTP Virtual Servers configure...

How to maximize the window?
Myfile.xls will be opened at 3 pm, which is scheduled task, whenever this file is opened, this excel is not maximizing the window, does anyone have any suggestions on how to set excel to be maximized the window, when this application is opened. Thanks in advance for any suggestions Eric How to start Excel with different switches http://www.tek-tips.com/faqs.cfm?fid=1371 ju.c "Eric" <Eric@discussions.microsoft.com> wrote in message news:3F0005D3-09A1-412F-B94D-14FAAD945CC8@microsoft.com... > Myfile.xls will be opened at 3 pm, which is scheduled task, whe...