Modeles dialog box

I have a modeless dialog box in an sdi application. the cursor shape changes 
to hourglass and then to the default pointer. I have the following 
questions-
1. How can I locate the dialog box at the center of the screen?
2. How can I control the mouse shape - I want it to be always default 
pointer?

Thanks

Marom 


0
marom1 (9)
1/20/2007 5:37:37 AM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
578 Views

Similar Articles

[PageSpeed] 58

1. Use MoveWindow.

2. Sounds like some code is setting the mouse shape. Normally, this doesn't 
happen automatically. Step through and see if you can determine when it gets 
set.

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Marom" <marom@john.com> wrote in message 
news:ew18YUFPHHA.3944@TK2MSFTNGP06.phx.gbl...
>I have a modeless dialog box in an sdi application. the cursor shape 
>changes to hourglass and then to the default pointer. I have the following 
>questions-
> 1. How can I locate the dialog box at the center of the screen?
> 2. How can I control the mouse shape - I want it to be always default 
> pointer?
>
> Thanks
>
> Marom
> 


0
jwood (1291)
1/20/2007 6:19:29 AM
> 1. Use MoveWindow.
Is there some paramter to locate it in the center or do I have to calculate
myself?
>
> 2. Sounds like some code is setting the mouse shape. Normally, this
doesn't
> happen automatically. Step through and see if you can determine when it
gets

I really don't set it manually but I suppose some code does it. Is there a
way to set it back to teh standard?

Thanks

marom


0
marim (1)
1/21/2007 11:10:16 AM
1. You could use CWnd::CenterWindow method.

Victor

"Marom" <marom@john.com> wrote in message 
news:ew18YUFPHHA.3944@TK2MSFTNGP06.phx.gbl...
>I have a modeless dialog box in an sdi application. the cursor shape 
>changes to hourglass and then to the default pointer. I have the following 
>questions-
> 1. How can I locate the dialog box at the center of the screen?
> 2. How can I control the mouse shape - I want it to be always default 
> pointer?
>
> Thanks
>
> Marom
> 


0
1/21/2007 12:02:54 PM
Marom schrieb:
> I have a modeless dialog box in an sdi application. the cursor shape changes 
> to hourglass and then to the default pointer. I have the following 
> questions-
> 1. How can I locate the dialog box at the center of the screen?

Don't forget about the multi-monitor situation. You need to decide where do you 
want to center your dialog. If you just center it on the complete desktop, then 
the dialog might be cut in two halves, each sitting on the edge of a monitor (on 
a two monitor setup).

Norbert
0
nunterberg (207)
1/21/2007 12:35:34 PM
On Sun, 21 Jan 2007 13:35:34 +0100, Norbert Unterberg wrote:

>Don't forget about the multi-monitor situation. You need to decide where do you 
>want to center your dialog. If you just center it on the complete desktop, then 
>the dialog might be cut in two halves, each sitting on the edge of a monitor (on 
>a two monitor setup).

You know, this is one of the things that annoys me most about the
Spyware Doctor program I run at home*. It's such a basic thing, you'd
think a developer would spot it during testing. Who wouldn't test on
multi-monitor these days?

* that the fact that the damn thing takes a geological epoch 
  to load its data files at startup.

--
Bob Moore
http://bobmoore.mvps.org/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
Bob
1/21/2007 5:45:18 PM
<Bob Moore> wrote in message 
news:lh97r29rdp5ld817hm6e3jmb7oqjf6tlp2@4ax.com...
> On Sun, 21 Jan 2007 13:35:34 +0100, Norbert Unterberg wrote:
>
> You know, this is one of the things that annoys me most about the
> Spyware Doctor program I run at home*. It's such a basic thing, you'd
> think a developer would spot it during testing. Who wouldn't test on
> multi-monitor these days?
>

Old code that uses GetSystemMetrics with CXSCREEN / CYSCREEN or CXFULLSCREEN 
/ CYFULLSCREEN

or SystemParametersInfo with SPI_GETWORKAREA

will still center the windows properly on the primary monitor.  So if 
developers are lazy and don't do anything, it should still be OK.  It's only 
when they go out of their way to get the virtual screen size, which was not 
added until later, that dialogs spanning monitors could happen.  So you're 
right, this is a case where a developer blindly changes something and 
doesn't even have the equipment to test it.  AFAIK, mostly developers don't 
use multi-monitors.  Even with equipment becoming more inexpensive, 
companies don't typically issue multi-monitors.


> * that the fact that the damn thing takes a geological epoch
>  to load its data files at startup.
>

I was appalled to find these spyware fixer programs mostly screw up the 
system even more than the spyware they're supposed to get rid of!  Even well 
known ones like Symantec need to have the realtime monitoring disabled or 
else the system will slow to 50% speed.

-- David (MVP)


0
dc2983 (3206)
1/21/2007 6:14:06 PM
Again, I would try and use the debugger to determine where it gets set. That 
would provide helpful information for deciding what to do about it.

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Marom" <marim@beni.com> wrote in message 
news:eCLZdxUPHHA.3268@TK2MSFTNGP03.phx.gbl...
>> 1. Use MoveWindow.
> Is there some paramter to locate it in the center or do I have to 
> calculate
> myself?
>>
>> 2. Sounds like some code is setting the mouse shape. Normally, this
> doesn't
>> happen automatically. Step through and see if you can determine when it
> gets
>
> I really don't set it manually but I suppose some code does it. Is there a
> way to set it back to teh standard?
>
> Thanks
>
> marom
>
> 


0
jwood (1291)
1/21/2007 8:07:14 PM
>will still center the windows properly on the primary monitor.  So if 
>developers are lazy and don't do anything, it should still be OK.  

Which is what suprised me.

>AFAIK, mostly developers don't 
>use multi-monitors.  Even with equipment becoming more inexpensive, 
>companies don't typically issue multi-monitors.

All our developers have multi-mon, it's such a boon with modern IDEs.
One of our guys has four monitors on his machine :-O

>system even more than the spyware they're supposed to get rid of!  Even well 
>known ones like Symantec need to have the realtime monitoring disabled or 
>else the system will slow to 50% speed.

Yeah, I don't have Spyware Doctor's real-time monitoring running, It's
such a hog I can't afford that. I just run it once or twice a week. 

I do run Kaspersky anti-virus all the time though, and I barely even
know it's there. Great piece of work. The only time I know it's
running is when it spots something nasty mixed in with the spam :-)

--
Bob Moore
http://bobmoore.mvps.org/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
Bob
1/22/2007 9:53:59 PM
Reply:

Similar Artilces:

Inserting Text Box within a Text Box
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Hello, <br><br>I am doing a newsletter (my own template) and would like to &quot;pull out&quot; a quotation. How do I get this smaller text box within the larger one and formatted so that the original text wraps around that box? <br><br>Thanks so much. You can't � Text Wrap is a property which affects only how the main text of the document flows around an object. It has no effect on text within objects. You can attempt it in a Publishing Layout document but still may not get the result you'r...

Changing the font size of a drop-down box content
I create a drop-down box in an Excel cell, using a list as the drop-down box content. When I then select the drop down box, the diplayed font size is tiny. How do I increase the font size? Take a look at this link from Debra Dalgleish's site http://www.contextures.com/xlDataVal08.html#Font "Ross Macadam" wrote: > I create a drop-down box in an Excel cell, using a list as the drop-down box > content. When I then select the drop down box, the diplayed font size is > tiny. How do I increase the font size? ...

Can't select
Access 2003. I have a subform that has a record source query. The query joins two tables. DeFault View: Continuous. Allow Edits, Adds, Deletes are all Yes. Data Entry = Yes. Locked = No, Enabled = Yes. Most other form properties are default. I successfully populate the ClassTitle ComboBox's Row Source with the following statement using the OnCurrent event: Me.ClassTitle.RowSource = DLookup("text2", "tblMenusVariables", "sequence = " & iSeq & " and reference = 'DAY'"). The RowSourceType is Value List for the Class...

Automatically finishes entering email into TO box
How do I tell MS Outlook to automatically finish entering into the TO box (sending email)when I begin typing the person to whom I am sending mail? thanks! What version of Outlook? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Gem asked: | How do I tell MS Outlook to automatically finish entering | into the TO box (sending email)when I begin typing the | person to whom I am sending mail? | t...

place toolbar on a dialog form
Is it possible to use a toolbar on a dialog form? I am trying to place a toolbar in code on a dialog form but it is not getting displayed. My project is not an SDI/MDI project but a dialog one and thus doesn't have a MainFrame class in which a toolbar is coded. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/_sample_mfc_DLGCBR32.asp Tom "Ayaz" <r_ayaz1@yahoo.com> wrote in message news:eThQNu93FHA.2872@TK2MSFTNGP15.phx.gbl... > Is it possible to use a toolbar on a dialog form? I am trying to place a > toolbar in code on a dial...

Form check box
I have a check box that's part of a form and have the information copy to a data base: ws.Cells(iRow, 2).Value = Me.txtMemberName.Value ws.Cells(iRow, 5).Value = Me.TxtDeposits.Value ws.Cells(iRow, 6).Value = Me.TxtLending.Value ws.Cells(iRow, 7).Value = Me.CBBroker.Value <---this line ws.Cells(iRow, 8).Value = Me.Txtmutualfunds.Value ws.Cells(iRow, 10).Value = Me.txtComments.Value The value that appears in the data base is "true" How do I simply change this to say "Yes" Thanks for your help if me.cbbroker.value = true then ws.cells(iRow, 7)...

Visio 2002 Performance Problems with UML Model
Hi I'm experiencing quite severe problems with a Visio model that I don't suspect is really that large. The file size is approx 7Mb and there are around 200 pages within the model. When I try to add a new diagram to the model it takes almost five minutes. I'm running off a hig spec machine with XP and Task Manager suggests that the processor is 100% occupied throughout these 5 minutes. Any suggestions? Thanks in advance Danny Visio is a serious memory hog. I experienced the same issue you are and, long story short, had to go up to 1 gig of ram to resolve it. Every tim...

? Post Window (Dialog) Creation Flag
Hi, I've searched high and low (mostly low) but can't find anything about how to determine if a window (specifically a dialog and it's controls) is completely created. As you know, a window may/will receive all kinds of messages while it's being created. Unfortunately, sometimes we write message handlers that are to be executed AFTER the dialog and all of it's controls are created. For example, moving/sizing controls in a dialog box is done in OnSize as expected. However, WM_SIZE is sent to the window before the controls even exist. To avoid an exception, you have to ...

Programmatically close dialog app
Hi, I want to programmatically close my dialog-based app from within the app itself. Can anyone tell me how to do this? TIA! Jan Roelof Call the EndDialog( n ) API. HTH -- ============ Frank Hickman NobleSoft, Inc. ============ Replace the _nosp@m_ with @ to reply. <jr_de_pijper@hotmail.com> wrote in message news:vdimrv83s1dcikosilin8jjenr9ce46usr@4ax.com... > Hi, > > I want to programmatically close my dialog-based app from within the > app itself. Can anyone tell me how to do this? > > TIA! > Jan Roelof > AfxGetMainWnd()->PostMessage(WM_SYSCOMMAND,...

Model
:confused: Does anyone know any good ways i can tackle the followin model (view attachment>) or which sheets i should be using, thanks Attachment filename: model.txt Download attachment: http://www.excelforum.com/attachment.php?postid=51642 -- Message posted from http://www.ExcelForum.com If you want help, describe your problem, with data examples. Asking people to open attachments is not a good idea. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "adn4n >...

Gridline box checked or unchecked. Gridlines do not print.
I'm new to excell and want to print gridlines. (Office 2003) With the gridline box checked or unchecked the gridlines do not print. Obviously, I must be doing something stupid. But what? Help appreciated, thanks, bobb File/Page Setup/Sheet tab, check Gridlines Bob Umlas Excel MVP "bobb" wrote: > I'm new to excell and want to print gridlines. (Office 2003) > > With the gridline box checked or unchecked the gridlines do not print. > > Obviously, I must be doing something stupid. But what? > > Help appreciated, thanks, bobb No response in...

GetOpenFileName + Using own dialog template
Hi. I have a question: I am using the GetOpenFileName function to display the Windows FileDialog. I want to use the EXPLORER functionality and therefore I declared the flag OFN_EXPLORER in the OPENNAME-structure. Now here is the problem: I want to use my own dialog-template instead of the standard-file-open dialog. So i wrote my own template and set the attribute templateName of the OPENNAME structur to my own template. Furthermore i activated the flag OFN_ENABLETEMPLATE. But when I call the GetOpenFileName function with these properties I get the errorcode CDERR_GENERALCODES and the dialog is...

combo box list shortcut
Hi I have a combo box on a VBA data entry form. One of the validated lists is approx 100 names long and is a pain scrolling through. Is it possible to maybe enter the first letter of the name and bring up only those beginning with that letter ? -- thanks Roy There's a MatchEntry property for the combobox. Try changing it to fmMatchEntryFirstLetter (either in code or via the properties window. Roy Gudgeon wrote: > > Hi > > I have a combo box on a VBA data entry form. One of the validated lists is > approx 100 names long and is a pain scroll...

Dialog box and Pasting
Hi there I have a modeless dialog box in an MFC application. I would like to catch the event of pasting and deal with it on my own but when the user presses the CTRL+V keys to paste (in the dialog box) I do not know how to identify that even and catch it or deal with it. Is there a way of doing this? Can I overwrite some function to do this that will identify the CTRL+V action of the user Thanks in advance Tom. This article might help you some: http://www.codeproject.com/dialog/pretransdialog01.asp Tom Tom "Tom." <anonymous@discussions.microsoft.com> wrote in message news...

modeless dialog and WM_MOUSEMOVE
I am handling WM_MOUSEMOVE on my main view for dragging operation.. my main view also includes modeless dialog box.... if the mouse cursor is over the dialog box, the main View doesn't get WM_MOUSEMOVE message and thus the operation is cancelled until the mouse cursor is again on the main View. How to handle this ? thanx This is the normal behavior. If you want to get mouse notifications even if mouse is not in the window, you can capture the mosue. Look at SetCapture/ReleaseCapture. ---------- Ajay Kalra ajaykalra@yahoo.com WM_MOUSEMOVE, unlike most mouse messages, is not sent to th...

Run Rules Now dialog
Windows XP Pro Office 2003 From the Run Rules Now dialog, is there a way to select all the checkboxes at once instead of having to individually select each one. I have a lot of rules so individually selecting each is painful. Thank you for any feedback. John, you wrote on Fri, 24 Mar 2006 16:25:08 -0800: > From the Run Rules Now dialog, is there a way to select all the checkboxes > at once instead of having to individually select each one. I have a lot of > rules so individually selecting each is painful. There is no way to select all rules at once. -- Best Regards Chr...

Combo Boxes
I have cascading combo boxes which are working fine, but how do I make them so that the user can either select a specific item in any particular combo box or ALL records for that combo box. i.e. Combo Boxes: 1. Group Select Group A 2. Category Select ALL I hope I have made sense. Your help in this matter is greatly appreciated. Greg Hi Greg, build the RowSource code for the combo on the GosFocus event -- see what is filled out and set criteria accordingly. On the Los...

Initial Domain Model Using Visio (Agile Data Modeling)
Hi !! We are developing an application for which we are following this article on http://www.agiledata.org/essays/agileDataModeling.html We are designing initial Domain model for system, and than go phase by phase as article suggest. We are trying to design inital domain model using Visio. However which template to pick up in visio? Thanks !! ...

A couple of list box problems
I have a form named 'Patient Information Form'. This is my main form. On this form I have a unbound list box that shows all the visits for all the patients. Problem #1 - I need the list box to only display the specific visits for that patient on the main form 'Patient Information Form' at that time. Problem #2 - I want to click on a specific visit date in the list box and open another form named 'Doctor Visit form' and edit the data. The issue I have, when I do click the data is the form opens with no problem. However it always goes to a form wit...

copy dialogs between projects
I have a test project which contains a form which I now want to incorporate into my application. I know how to copy the dialogs class and supporting classes as they are just text files. How do I copy a dialog (within an RC file) to a different project. Thanks Malcolm Clarke I forgot to say I am using Microsoft Visual Studio .NET 2003 ta "Malcolm Clarke" <not4bad@hotmail.com> wrote in message news:u9sIzPCSFHA.2932@TK2MSFTNGP09.phx.gbl... > > I have a test project which contains a form which I now want to incorporate > into my application. I know how to copy the ...

Grant Mail Box Access
I want to grant another user access to my mailbox. Exch Server 2003 - Outlook 2000 clients. So far I have: Accessed properties of me as a user in Active Directory On Exchange Advanced: View and access permissions on this mail box button Added second user into Mail Box Rights window Ticked Allow Read Permissions Logging on to another machine as this user and trying to "Open other users Inbox" from Outlook returns the message <The information store could not be opened> Anyone tell me where I am going wrong please? TIA Phil You will need to give this person the "ful...

lock text boxes and only let 30 charcters in that text box
I want to lock text boxes that overlay on my master document. I only want to let the user type just 30 characters in that text box and make the box were it will not move around on the pub sheet if the user makes it move with the mouse...can this be done? ...

Select CBO and autofill text box
Hello, I am working on a database which I would like for the user to make a selection from a cbo named "Title/Description" and once selected, have the "Purpose" field prefill with the corresponding Purpose for the selected Title/Description. I never tried this before and not sure how hard it is. I was going to use If, Else statements but there is about 75 Title/Descriptions and Purposes. I was hoping for a way to put them in a table. If possible, please simplify answer explaining how this needs to be accomplished. Thank you!! Stockwell43 wrote: >I am working o...

the Problem about calendar show at the day/week/month model
1:I created an appoint. but at the day/week/month model, can not show the subject. if I change the model to"by category" , the subject show again. 2: the reminder can not work normaly at any model. any suggestion be appreciate. Richard rxj88@hotmail.com, you wrote on Thu, 15 Dec 2005 17:34:41 +0800: > 1:I created an appoint. but at the day/week/month model, can not show the > subject. if I change the model to"by category" , > the subject show again. Start Outlook once with the parameter /cleanviews Start | Run | outlook.exe /cleanviews > 2: ...

GP 10 [home -> Purchasing -> All Purchasing [search box]
A great new window in ‘sales transactions, and ‘ Purchase transactions’ offering a transaction view on the bottom of the page . The search feature [Type to Filter] only searches column headers. It would be extremely helpful if this search feature allowed searches for content on the document, e.g. ‘purchase order #, or item #. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to ope...