resize a fixed dialog

I am trying to figure out how I can resize a fixed dialog running in another 
process.  I have set a WH_CBT hook and added the WS_THICKFRAME style upon 
creation.  This achieves the affect of having a sizeable window border 
(sizing handle on lower right corner; cursor changes to sizing cursors when 
hovering over border).  But I cannot actually resize the border.

What I am not sure about is how I can monitor for the sizing-related 
messages.  In Spy++, there are absolutely no sizing-related messages being 
posted.

I happened to find a freeware utility called, ResizeEnable, that manages to 
do what I am trying to do for the most part, that is, resize the window, but 
it has an algorithm that just stretches every control on the window...I do 
not want that behavior.  According to its documentation, it runs in the 
system tray and hooks all 'unsizable' windows and intercepts all messages 
associated with sizing.  This is where I am lost.  What hook would I use to 
do this?

When this freeware utility is active and I look in Spy++, I now see many 
more messages being posted as I resize a dialog.  Why are all these messages 
suddenly being posted in Spy++?  What is that program doing to make that 
happen?

Thanks,
Jeremy
0
JR1 (208)
12/23/2008 6:39:02 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1948 Views

Similar Articles

[PageSpeed] 5

You will need to add the SC_SIZE command to the system menu of the window 
that you want to change to sizeable.  And instead of WS_THICKFRAME you can 
simply use WS_SIZEBOX.


AliR.

"JR" <JR@discussions.microsoft.com> wrote in message 
news:74BA7A41-30F0-43D7-B6C8-A61ACA119E92@microsoft.com...
>I am trying to figure out how I can resize a fixed dialog running in 
>another
> process.  I have set a WH_CBT hook and added the WS_THICKFRAME style upon
> creation.  This achieves the affect of having a sizeable window border
> (sizing handle on lower right corner; cursor changes to sizing cursors 
> when
> hovering over border).  But I cannot actually resize the border.
>
> What I am not sure about is how I can monitor for the sizing-related
> messages.  In Spy++, there are absolutely no sizing-related messages being
> posted.
>
> I happened to find a freeware utility called, ResizeEnable, that manages 
> to
> do what I am trying to do for the most part, that is, resize the window, 
> but
> it has an algorithm that just stretches every control on the window...I do
> not want that behavior.  According to its documentation, it runs in the
> system tray and hooks all 'unsizable' windows and intercepts all messages
> associated with sizing.  This is where I am lost.  What hook would I use 
> to
> do this?
>
> When this freeware utility is active and I look in Spy++, I now see many
> more messages being posted as I resize a dialog.  Why are all these 
> messages
> suddenly being posted in Spy++?  What is that program doing to make that
> happen?
>
> Thanks,
> Jeremy 


0
AliR3470 (3236)
12/23/2008 10:04:38 PM
I believe you can find an article about this on www.codeguru.com.

"JR" <JR@discussions.microsoft.com> wrote in message 
news:74BA7A41-30F0-43D7-B6C8-A61ACA119E92@microsoft.com...
>I am trying to figure out how I can resize a fixed dialog running in 
>another
> process.  I have set a WH_CBT hook and added the WS_THICKFRAME style upon
> creation.  This achieves the affect of having a sizeable window border
> (sizing handle on lower right corner; cursor changes to sizing cursors 
> when
> hovering over border).  But I cannot actually resize the border.
>
> What I am not sure about is how I can monitor for the sizing-related
> messages.  In Spy++, there are absolutely no sizing-related messages being
> posted.
>
> I happened to find a freeware utility called, ResizeEnable, that manages 
> to
> do what I am trying to do for the most part, that is, resize the window, 
> but
> it has an algorithm that just stretches every control on the window...I do
> not want that behavior.  According to its documentation, it runs in the
> system tray and hooks all 'unsizable' windows and intercepts all messages
> associated with sizing.  This is where I am lost.  What hook would I use 
> to
> do this?
>
> When this freeware utility is active and I look in Spy++, I now see many
> more messages being posted as I resize a dialog.  Why are all these 
> messages
> suddenly being posted in Spy++?  What is that program doing to make that
> happen?
>
> Thanks,
> Jeremy 


0
cli4 (6)
12/24/2008 2:00:36 AM
Reply:

Similar Artilces:

DLL Programming: A webbrowser on a Dialog....
Hi All, I m creating a MFC Dll -> Regular Dll with statically linked MFC. In this Dll project, I have a Dialog Box. I tried to create a Web Browser on this dialog box in two ways: 1: Insert ActiveX control 2: Using CHtmlView class In both cases, I failed. No compilation err generates.But, --->> If I use first way (Web Browser Control) even dialog box not created. --->> If I create CHtmlView object at runtime using Create(..) function, Assertion Faied err generates when I call Create function for CHtmlView object. CODE IS AS BELOW: /******************************************...

faq how to add print to dialog
Hi, There is a graph in my dialog based programme. The demo code is based on CView, so it has OnPreparePrinting(CPrintInfo* pInfo) OnPrint(CDC* pDC, CPrintInfo* pInfo) How I can add those function to my code? Or to create the device context of it. The graph is creat on a static control. I realy need the CDC* pDC . Thank you so much. You might want to consider using an SDI formview architecture instead. It's still a little mysterious doing print from there, but it's easier: http://www.codeproject.com/printing/printformview.asp Here are a ton of articles on printing: h...

Display time in dialog box
Hi All, I am currently trying to display the time in a dialog box application. It is been displayed in a Static box when the program loads but then I don't seem to be able to refresh it every second. The code I am using is shown below: Any help would be very much appreciated. Cheers Fabrice void CMyDlg::OnTimer(UINT nIDEvent) { if (nIDEvent == m_nTimer) { CTime ct = CTime::GetCurrentTime(); CString Temp; Temp.Format("%02d:%02d:%02d", ct.GetHour(), ct.GetMinute(), ct.GetSecond()); } } void CMyDlg::PreSub...

problem:crash on dialog exit.
I have an application which receives data from the socket and displays them on the list control embedded in a Dialog. Before doing DoModal I begin the worker thread to which I have passed a dialog pointer. after receiving one row of data, the worker thread sends a message to the dialog and the message handler inserts the row in the list control. Everything works fine till now. When all the data has been received and the thread has exited....user clicks OK button. The application crashes. This happens only in the release mode. I changed the project settings to see the callstack and here it is ...

Resize the MFC ribbon
Hi, I'm creating a new application using the MFC Ribbon. However I'm struggling with a very important issue, I did not succeed to resize the ribbon height. The ribbon is too big, and I do not know how can I decrease its height. Any solution ? ...

How do I resize a complex Excel template?
I bought a template to make a calendar, the template is wonderful but doesn't fill a full 8.5X11 sheet of paper, I've tried adjusting the margins, fiddling with the print at %, and everything else I can think of. Is there anyway to enlarge the calendar without resizing every cell? ...

How to resize title of a chart in Excel?
Hi, Would you please tell me how to resize the title of a chart in Excel? Thanks, Roger Left-click on it then drag the handles to re-size. Gord Dibben Excel MVP On Sun, 31 Oct 2004 11:47:01 -0800, "Roger" <Roger@discussions.microsoft.com> wrote: >Hi, > >Would you please tell me how to resize the title of a chart in Excel? > >Thanks, > >Roger The Chart title will adjust automatically to the size of the text. If you want more control over the width or height, you can delete the title, and use a text box instead. To create a text box, select the ch...

Hang you can simulate with ATL composite control, MFC dialog and Radio buttons
Hello, I am facing a very wierd problem. I have an ATL composite control and am trying to host it on an MFC dialog. When a radio button on the MFC dialog is clicked, the application hangs. In Visual Studio.NET 2003, when testing the dialog, if you click the radio button, Visual Studio hangs. I tried searching for this problem on the forums but could not find anything. Here are steps to reproduce the problem (I have checked this on a Windows 2000 PC): a) Build an ATL composite control with a single edit box (or any other control) in the dialog box. Make sure that the project is *not* attribu...

Dll function creating MFC dialog..
Hi I am facing a crash only in 2k with the following scenario . In XP and 98 this problem is not observed In my scenario I have X.exe, Y.dll. Y.dll exports a function (say Z) which has DoModal() of a dialog called. X.exe on click of a button starts a thread and in that thread calls the Z method which shows up a dialog. The problem happens when the button is clicked thrice or more than thrice. The three dialogs are lauched in three threads and are shown. But if I try to move the dialogs, After some time a crash is seen, whcih occurs in a method of MFC42.dll. More information about the scen...

How to copy dialog resources from one project to another?
Hi, I have 2 projects and quite a few dialogs are the same. Is there a way to copy dialog from one project resources to another? Or to share it? Under VC6.0. Thank you, Kelvin Open workspace 1, select dialog and Edit/Copy Open workspace 2 (in same instance of DevStudio) and Edit/Paste Pain in the bum. Wish they would go on windows clipboard, but they don't - copy buffer is internal to DevStudio You could make a DLL containing resources that are shared frequently, but its a bit less convenient to access the resources and it complicates installation. Kelvin wrote: > Hi, > >...

getWindowText in Child Dialog
I am relatively new to C++ and this is the first time I've tried to communicate between different dialogs in my project. At this point I want the user to click the "Apply" button located in the Parent Dialog to save text located in an Edit Control on a Child Dialog. But when I run the code below I get an assertion failed message in wincore.cpp on line 1098. Then the program continues to run however getWindowText does not extract the Edit Control's text but instead a blank string: This Parent class contains the following: void CpnDlg::SaveAll() { TRACE("Saving...\n&...

Managing dialog components without a dialog templet
Hi, I would like to write an application where the dialogs corresponding to a number of options are similar, except for a few changes in each case. Because of this I would like to write a base class that contains the common components, and then derive the classes I need from this base class. What I need for this exercise is the ability to create and display the items that each concrete class adds explicitly. I started this by adding the following code to the OnInitDialog() method: HWND hWnd = GetSafeHwnd(); CWnd *dialog = CWnd::FromHandle(hWnd); CButton *button = new CButton(); RECT ...

Using CHtmlView in a dialog (VC6)
I have an old application (VC6) that uses CHtmlView in a dialog. It works fine for online browsing but crashes the app on some sites (e.g. Wikipedia). Does anyone know if VC6 compiles CHtmlView against IE4 or does it use a newer version? Also, is there a more up-to-date option for embedding a browser in a dialog using VC6? Thank you all. You don't have to rig a CHtmlView in a dialog. You can simply use the browser control http://msdn.microsoft.com/en-us/library/aa752046.aspx http://www.codeproject.com/KB/IP/CustomBrowser.aspx Have you create a simple SDI program that uses the CHtmlVie...

Fix for Publisher 2007 webpages that don't display correctly in IE8
Publisher 2007 Grouped Design Gallery Objects display as blank areas in IE 8. From another thread, I discovered that ungrouping the objects restores their visibility in IE 8. In my particular web page, the Navigation bar, Boxes, and Marquee where affected. I invested a couple of days trying to find a solution for the pages that did not display correctly. One suggested solution was to use Aggornio Internet Explorer 8 Compatibility Wizard. While that may work for others with IE 8 webpage problems, it did not work for the Grouped Design Gallery Objects problem. Fortunately, ungrouping them did t...

CDC functions on top of a static control in a dialog
Hi all, I'm tring to add a little simple animation to a bitmap resource that's displayed in a static control. I had used a timer to trigger an animation function but nothing appears if I'm trying to paint in the area of the bitmap (otherwise it shows fine). I suspect that the static is receiving a wm_paint message after I've done my animation. So... without subclassing my static control and handling the paint myself, is there a way I can add code to the dialog class to handle the paint messages of its controls? Thanks. (ps eVC 4 on a Fujitsu Teampad but I reckon embedded MFC...

Listbox of File Names does not Filter in Open File Dialog
Hi, I use the CFileDialog and a file filter to open a File. Everything works fine. The file selection box in the upper side works with the given file filter. I am having one little Problem with the selection box of the FILE NAME. This selectionbox will only get active, when I enter one character in the editfield of the file name. Then there will be showed absolutly all files with this character. This box ignores the filter. I tested some programmes and found out, that only MS Office 2003 and 2007 are doing a correct job. Now I would like to ask, if this is a MS bug and if there is an easy w...

Business Portal, Req Mgmt
We want to change the Filter By selection list for specific users. It seems that this system has hardcoded the list into the page and the filter cannot be changed. We have some users that have a standard set of requisitions that we have saved for them. We had hoped that the filter by list could be altered to show their 'My Saved Requests' as the default. Unfortunately, although this system is built into Business Portal, we do not have the flexibility of SharePoint to make any changes to the Req Mgmt pages. ---------------- This post is a suggestion for Microsoft, and Microso...

Draw fixed length line in detail section
My report has a report header approx 1.5" tall, a page header approx 0.5" tall, followed by the detail section. How can I print a fixed height detail section with verticle lines even if there are only a few records? Essentially, trying to replicate a paper form. The line starts at the bottom of the page header and continues to the top of page footer. In a post a couple days ago, Allen Browne recommended the below for drawing a line down the entire page.....this close, and I am trying to figure out a similar approach for the detail section. Private Sub Report_Page() Me....

4562 report in fixed assets
The fixed asset module should provide this report (for Federal tax filing). Most other asset modules provide this form. This can be a deciding factor in purchasing Great Plains. ---------------- 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 open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutio...

Salv error: Fixed records in Report Custom Pool table
I noticed some reports in my Monday 2007 file failing. I ran salv.exe L2 and if found errors "Fixed records in Report Custom Pool table" I am looking for advice on what to do? 1) Continue w/my current Money file and redo my reports and see if the error goes away. 2) OR Use the repaired Money file and start from their. Any ideas on how serious this message is "Fixed records is Report Custom Pool table"? Thank-you! In microsoft.public.money, quest wrote: >I noticed some reports in my Monday 2007 file failing. I ran salv.exe L2 >and if found errors &quo...

Hardcoding print dialog box printer...
Hi all. I'm not really much of a C++ programmer but I need to modify some old code to print directly to the Adobe Distiller printer installed on the users machine. I have been able to get new devname and devmode structures using some code I found on the MS site that changes the default print driver on the dialog box to the Adobe Distiller, but when I don't get a good return when I make the GetDefaults call. It does work if I display the dialog box but I don't want the dialog box to show up in this case. The code works fine if I remove the new code to change the print driver ...

Trying to automate somethin'/Bybassing dialog
I have an Excel Macro that sending emails. However when being transferred to Outlook 2000/XP, there is always a dialog popped up asking for confirmation that is from another lauguage which means "Some application program is trying to send emails on your behalf. It could be a virus, do you want to continue with this operation?" How do I bypass this dialog? Thanks Jack http://www.outlookcode.com/d/sec.htm Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Jacky Luk" <jl@knight.com> wrote in message news:egcrZaKPE...

zero or negative numbers dialog box
One of my users posted the following message to our help desk. I really don't know a lot about Excel, so I was hoping someone could help me out: A frustrating feature of Excel: Excel sends messages that there are zero or negative numbers in log-log plots of data. However, there aren't any zeros in the data, so it can't be fixed! Grrr! THis problem seems to happen more often when there are lots of charts in the worksheet. Any hints? Any help that can be provided would be greatly appreciated! Thanks! Danni ------------------------------------------------ ~~ Message posted...

Fix the bar graphs in Excel
How do you fix the bar graphs in Excel so that the bars are proportionately the correct size as the other bars in other graphs? You want them the proportional in height? Use the same axis scales. You want the same widths? Use the same numbers of categories and series in each chart. Otherwise you'll tweak yourself to death.... - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ yo wrote: > How do you fix the bar graphs in Excel so that the bars are proportionately > the correct size as the oth...

Outlook Won't Resize
Hello, I have this problem with outlook express. For one of my email account, the outlook window can not be re-sized. I can click on the minimize button, but it won't do anything. Please help. Thanks. Eric This newsgroup is for support of Outlook 97, 98, 2000 & 2002 from the Office family for Windows PCs. For Outlook Express (OE) support try posting in one of these newsgroups: microsoft.public.inetexplorer.ie4.outlookexpress for OE 4.x microsoft.public.windows.inetexplorer.ie5.outlookexpress for OE 5.x http://support.microsoft.com/newsgroups/default.aspx?ICP=GSS3&NewsGroup=mi...