main form deactivation


I have simple question. How to catch the event when my main application
window is being minimized or sent to background by another application (no
its own window)



as_shark (1)
1/4/2007 8:58:50 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 40

>I have simple question. How to catch the event when my main application
>window is being minimized or sent to background by another application (no
>its own window)


Handle the WM_ACTIVATEAPP message.

davidl7375 (2060)
1/4/2007 9:49:26 AM
"shark" <> wrote in message 
> Hi
> I have simple question. How to catch the event when my main application
> window is being minimized or sent to background by another application (no
> its own window)

Handle the OnSize() of your main app window.  The nType parameter tells 
whether it is being minimized.

-- David

dc2983 (3206)
1/4/2007 2:05:50 PM
WM_ACTIVATEAPP will tell you when your application is being deactivated ("sent to the
background" is not the correct characterization; it is not sent to the background, the
other app is brought to the foreground.  There is a seriously important distinction here).

WM_SIZE gives you a parameter that tells you if you are being minimized, which is
unrelated to being deactivated.  Make sure you know which one you want before deciding
which one to use.  An app can remain active but be minimized; it can be deactivated
whether it is minimized or not.

On Thu, 4 Jan 2007 09:58:50 +0100, "shark" <> wrote:

>I have simple question. How to catch the event when my main application
>window is being minimized or sent to background by another application (no
>its own window)
Joseph M. Newcomer [MVP]
MVP Tips:
newcomer (15975)
1/5/2007 12:48:37 AM

Similar Artilces:

hide a text box in a continuous form
I have a form that i created that display each form as a row in a continous form. What I need is to have one text field on one row not visible when a check box is checked. Does anyone know how to do this? Thanks! Using Conditional Formatting, evalaute the state of the field bound to the CheckBox to set the Background color of the TextBox to match that of the Background color of the form. You might have to set the Disabled prop via CF as well. There is sample code showing one wat to accomplish this here: A2K or Higher Only! New Feb 08,2002...

In role Form\insertAction\sendEmail\description(please help)
hi add date field to this section ,but when I recieve this Email I cant see datefield ...

Form as Web Page
It has been many years since I used Access, but I would swear that I used to be able to save/export the form as an HTML or at least make it look like a webpage. I want to be able to open the form and add/modify records without having access to (or even see) the tool bars, etc... Yes you could save as a Data Access Page. Does not have all the functionality of regular forms. Maybe this would help: MS Access 2010 will be released in June and has the ability to build web databases. Quite nice from what I have seen. The ...

Form creates unwanted rows in table
I've created an asset database which keeps track of computers, laptops etc. There is one company which has many departments and every department has many rooms. (surprise, surprise) There are four tables: tables Department and Asset and two "middle" tables DepartmentRoom and AssetRoom. The table structures are as follows: DEPARTMENT id name dep_type dep_num etc... ASSET id name a_type ip_num vendorID serial_num etc... DEPARTMENTROOM id name depID (foreign key to department) ASSETROOM id assetID (foreign key to asset) roomID (foreign key to depa...

How do you get the maximum value to display in text box form
In a form, if I have 4 text boxes and 3 of them will contain a number. How do you get the maximum value to display in the 4th. I have tried many different things, I can make it work for a single field in a table, but that finds the value through all records. I just want it to display the max value from the numbers on the form, which could be different for various records. You could use something like this as the Control Source of the 4th text box (the underscore is for ease of reading here, and must be removed from the Control Source): =IIf([Field1]>[Field2] And [Field1]>[Field3],...

Can't get Date Range to work from Form to Report
Hi, I've followed Allen Browne's directions very closely for creating a form for a date range to limit results to that date range on a report and can not get it to work for some reason. I've read many threads on this board which all say the same thing and it seems to work for everyone else. :( Here's what I have: A form with two unbound text boxes called [txtDateBegin] and [txtDateEnd]. The form is called "frmDateRange" and the report is called "Sales Activity Report". The two unbound text boxes are set to "Short Date" format which the user ...

Can a form update a database?
I need to create a conference call agenda/meeting minutes template. On it I'd like to use check boxes to note who of the invitees showed up. I'd like to be able to get a listing of all the people (who may or may not be invited to all meetings) and the dates they attended. Can a form in Excel populate a database or could the form populate another Excel file? I'm real stupid about how to do things like this - does anybody have advice or maybe even a simple example? Thanks! I'd put the checkboxes in column A (say A1:A20) and link each checkbox to the cell underneath the check...

Format TextBox to Currency in a Form
Hi, I am having trouble formatting textbox in a form. Here is a little background on what i did in a form. I have a combobox that has all the company names. I am populating textbox results by selecting company name from the combobox. For Example, If i select CompanyA from the combobox then the textbox1 will populate its revenue. But, its populating in a general number format without any decimals. I tried everything from changing the property in the textbox and the source table. But i have no luck getting the Currency in the format. Can someone please help me with my isssue. ...

Subreport in Form
Howdy! Virtually, what I would like to do is put a subreport in a form. Reading around, I have discovered this to be impossible ;). Basically, what I have is a report building form that I would like to have a preview of the report off to the side. Is there a practical way of accomplishing this? I am using Access 2007. Thanks for any input! ...

Data entry forms
Is it possible to create a data entry form in outlook (2003 or 2007) where the user could fill-in fields... and then send it back to the originator? If so, how? What is it called in outlook so I can look it up further? QB You can use Custom Forms for this or use InfoPath if you have that installed for your users as well. A good resource to get you started with custom forms and VBA see; -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 Outlook FAQ, HowTo, Downloads, Add-Ins and more h...

Making custom form default for contacts
Hello: I am a beginner with Outlook. I am a new hire in a department that uses Outlook contact information in a Word Mail Merge process. I am teaching myself how this all works, and have been doing ok, but I am struggling with forms, particularly the form used for contacts. I don't have any problems modifying the form (for example to add FirstName and LastName fields), but I am very confused about how to get Outlook to use my modified form instead of the default custom contacts form. It seems to me that this should be a simple property setting, but I've had no luck tinkering w...

How do I create drop down form fields in Excel?
Is it possible to create dropdown lists in Excel? If so, how do I do it? Thanks You can use Data Validation to create the dropdown lists. There are instructions in Excel's Help, and here: Micki wrote: > Is it possible to create dropdown lists in Excel? If so, how do I do it? > > Thanks -- Debra Dalgleish Excel FAQ, Tips & Book List ...

How to sometimes open form to new record?
I have a parent form which is then linked to a child form. I want to have two buttons on the parent form, one to open the child form and display all the records with the corresponding foreign key, and one button to open the child form to a new record with the corresponding foreign key already inserted. I have figured out how to open the child form to a new record, but I cannot figure out how to insert the parent ID into the child foreign key. Help! Thanks. Megan, You don't have to enter the ParentID in the Child subfrom records... Establish a one many relationship between the Pa...

One or more rules could not be uploaded to Exchange server and have been deactivated.
I originally posted this topic in the Outlook newsgroup but I am not sure if it was the right section for that so I will try here. We are running Exchange 2003 and we have a problem with just one user receiving the following error: "One or more rules could not be uploaded to Exchange server and have been deactivated. This could be because some of the parameters are not supported or there is insufficient space to store all your rules." I already checked the following MS KB and it does not apply: This user does not have too many rules - this...

Promted for opening of attachment form Outlook
I have tasks linked to notes in One Note, whenever I click the attachment to open the notebook, I get a "Opening Mail Attachment" you should only open attachments from trustworthy.......... and the " always ask before opening" box is checked and grayed out so I cant change it. Although not the biggest problem in the world, it is an annoyance. Any thoughts on how to eliminate this? -------- Original-Nachricht -------- > I have tasks linked to notes in One Note, whenever I click the attachment to > open the notebook, I get a "Opening Mail...

Is there any way to use outlook forms in public folders through OW
No. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "You''ll never walk alone" <> wrote in message > ...

Form Combo Box
Hi In Cell A1 I have a link to a Index function that uses Indirect(A1) to look up a named range. I also am making a form, and I just want the form to choose between some names that are located in cells "Z1:Z10" of the worksheet and put the selected name in Cell A1. How do you link the combo box to cells Z1:Z10, and put your choice in cell A1? Thanks a lot for your help Hi see: -- Regards Frank Kabel Frankfurt, Germany Jeff wrote: > Hi > > In Cell A1 I have a link to a Index function that uses Indirect(A1) > to...

Changing & recalculating default values on a form
There are a number of occassions in my application where I use a calculated control (1) as the default value for an unbound control (2). Most of the time the user will accept this value and move forward; however, if one of the underlying values upon which the calculated control (1) is based changes, I would like the value of the unbound control (2) to be updated. I do not want to bind the control (2), because there will also be a few times when the user will need to change its (2) value independent of the value calculated in Control (1) Can I do this? Thanks so much. =?Utf-8?B?TGVM...

code to change a form's allows?
I am wondering what the code syntax is to tweak a form's allows? Allows deletions? Allows Adds? etc I know how to do it in the right-clicked form properties manually, but I need it to be based on conditions. Reason I need this is because I have one form that all users open. Depending on their window's username, I have a security table that tells me what role I want them to have in the database. Depending on their role, some users have more rights than others on this form. I want to adjust the form to allow additions for some users, but not others. Me.AllowAdditions = Fals...

forms #6
i have the following working within a macro:. 'copy the data to the database ws.Cells(iRow, 1).Value = Me.txtPart.Value ws.Cells(iRow, 2).Value = Me.txtLoc.Value ws.Cells(iRow, 3).Value = Me.txtDate.Value ws.Cells(iRow, 4).Value = Me.txtQty.Value Is there any way a can change this to do the following:- when i open the form it moves to the next column, for example if i allocate cell AF 21 then the next time i open the form it would go to cell AG21 Thanks Monty Sorry the full macro is this Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Part...

Using a custom form kills forward/reply arrows in the inbox?
Hi, I installed a custom email form in Outlook 2000 and the "Forward" and "Reply" arrows on mails in the inbox disappeared. The arrows reappear on new mails when I swap the default back to IPM.Note but as I really have to use this custom form the absence of the Forward/Reply indicators is a pain. Has anybody come across this issue before? Is there a method to turn these "flags" back on or do I have to dig into the code in the custom form? The custom form is just a modied IPM.Note that provides access to a COM plugin. Thanks! Fin Known issue, dating back t...

Using form to enter "query criteria" (between values)
Good morning everyone, I want to create a form with two boxes, where first box is lower limit of the value and the second upper limit. This values should be used in my query as filter criteria. Like this (query filter criteria): > "textbox1" AND < "textbox2" Does anyone know how I can build this in a form (i.e. connect my textboxes and query criteria)? Kindly, Mikael Sweden By thinking about for another minute I found the (simple) answer. In the query criteria I put the following expression: BETWEEN [forms].[nameofform].[NameofDatefield1] AND [forms].[name...

Meeting Registration Form?
I have a customer who wants to be able to post a meeting on a shared calendar in the corporate public folders of her company, then have employees be able to click on that meeting and be able to register for it there. Is there a form anyone knows availabel for this, or is this concept even do-able. -- Mike Exchange 2007, Outlook 2003 and 2007 clients. Whether it's feasible depends on exactly what you mean by "register for it." -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators htt...

text form field in a cell
I have built a form in a table. For each field I have inserted a text form field into a cell of fixed size larger than the text field object. Is there a way to make it so that if you click anywhere in the cell that the cursor moves to the text form field that is in that cell. Currently if you click in the cell the cursor will move to the next text form field in the table. Any suggetions including changing the form format by not using form fields woud be apreciated. Have you protected the document for filling in forms? -- Hope this helps. Please reply to the newsgro...

Automate sync deactivating
We've got about 40,000 contacts in our CRM 3.0 implementation with about 30 owners. We would like to disable the syncing of contacts and the removal of the CRM-sourced contacts in Outlook in an automated fashion. Is there a way to do this? We could go around to all of the workstations, but would prefer a script or something to handle it. I tried playing around with the SyncContact registry setting in the HKCU\Software\Microsoft\MSCRMClient key, but it didn't seem to have an effect. Also, to prevent these from happening in the future, can the installs be set to default with ...