|
I am having a problem with a dialog box and toolbar buttons. I cannot go into very much detail regarding all this code, since it is for my place of employment. But in our product, there is a main toolbar, which has several buttons. One of the is for user preferences. If the user has other windows open, clicks on this window, then goes back to another open window, he/she will have a problem when they click on the main toolbar. No matter which button is pressed, nothing happens because the dialog box is open and behind other windows. This isn't code that I have written but I am one of those responsible for maintaining. The code is written in C, not C++, MFC, or C#. I would like to be able to set the focus on the dialog box if anything on the toolbar is pressed. The problem is that I cannot find a way to do it, since I cannot seem to capture the message when the something on the toolbar is pressed.
A little detail, the toolbar is actually one bitmap, which contains several images. We have a special function that applied each individual image and makes it a button. So if the dialog box is open and behind other windows, it doesn't look like anything is getting pressed. Please HELP!!!!!
|
|
|
|
|
I'm trying to understand the exact problem, but it's not clear. Perhaps if you can explain it again by (1) saying what kind of app this is (ie., MDI, SDI, Dialog based), and (2) the sequence of steps taken to reproduce the problem.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Alvaro Mendez wrote:
(1) saying what kind of app this is (ie., MDI, SDI, Dialog based)
This is a mixture of all three. It is a big application, with about 10 to 15 buttons on the main toolbar that opens windows, with the exception of the user preferences, which is a dialog box.
Alvaro Mendez wrote:
the sequence of steps taken to reproduce the problem.
The sequence is simple. Just click on one or more buttons that brings up windows (not dialog boxes but actual windows) and then click on the button that brings up the user pref dialog box. Then, click on one of the other windows you brought up, not the button but the actual window. Now, the dialog box is hidden behind the other windows. When you try to click on a button on the main toolbar, nothing happens and the dialog box is hidden.
|
|
|
|
|
Maybe this an ownership problem? If the dialog that appears
when you lick on a button was owned by the window hosting that
toolbar, it should always appear above the window-- never
behind others. Make sure the call to create your dialog box
passes in the handle to your applications main window.
|
|
|
|
|
Hi All,
How is it possible to hide the console window in c or C++ program?
Thanks in Advance
San
|
|
|
|
|
|
I'm looking for a "CScrollWnd" version of CScrollView -- basically one that I can derive from without requiring the document/view architecture. Is there such a beast?
If not, is there a good tutorial somewhere for doing all of the scroll stuff (proper tracking sizes, etc?). I'm making a custom control and it's been a quite while since I've had to do this.
Thanks in advance!
|
|
|
|
|
You can create a CWnd with the WS_HSCROLL and WS_VSCROLL style.
learn all you can from MSDN's pages on scrollbars.
Max.
|
|
|
|
|
dear all,
i have an mfc dlg based app which adds an icon in the taskbar, which on dbl clicking shows up a dialog box.
this dialog box is not the main window of my app.
the main window is a frame which is hidden (m_pMainWnd= CFrameObj) and this frame is also associated with the taskbar icon.
the problem is every time i dbl click on the icon, a new dialog box appears but i want only one dialog at a time
how do i go 'bout it?
|
|
|
|
|
|
my dialog is not the main window of application
so this can't work
any other way?
|
|
|
|
|
I use a static variable:
static HWND s_hWnd = 0; //window handle of this dialog
int CMyDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(s_hWnd) {
::SetForegroundWindow(s_hWnd);
return -1;
}
if(CDialog::OnCreate(lpCreateStruct)==-1)
return -1;
s_hWnd = m_hWnd
return 0;
}
void CMyDialog::OnDestroy()
{
if(s_hWnd==m_hWnd) s_hWnd = 0;
CDialog::OnDestroy();
}
|
|
|
|
|
Hi
i need Some good tutorial on MFC programming.
if u know any site or PDF file for this plz give me it's address.
thanks a lot.
|
|
|
|
|
www.codeproject.com[^]
They even have forums where you can ask specific questions if you get stuck.
msdn.microsoft.com[^] is a good reference, but no-where near as user friendly as www.codeproject.com[^]
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Nice answer!
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Check out the MFC tutorials on MSDN[^]. I got a pretty good jump into MFC with the Scribble tutorial, ages ago. Just make sure you're proficient in C++ before starting.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hello
i have to open word,excel and powerpoint files without installing MS OFFICE( i.e no word,excel and power point is present) tell me is it possible?
|
|
|
|
|
I think it is not possible, At least you must have excel, word,.. installed.
|
|
|
|
|
Is it possible that we use word components etc i.e use them wothout installing word etc and then we can ship them with out product to client?
|
|
|
|
|
bazoon wrote:
Is it possible that we use word components etc i.e use them wothout installing word etc and then we can ship them with out product to client?
No. Your client would need to have Office installed on their computer, if you were using Office components in your code. At least that's what the last licence agreement I read for Office Developer said.
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
Microsoft used to have Viewer applications for all these file types. Have a look on the office web-site. I know I downloaded a Powerpoint viewer a little while back.
Alternativly, have you looked at http://www.openoffice.org/[^]
Michael
Fat bottomed girls
You make the rockin' world go round -- Queen
|
|
|
|
|
I want to draw on the ActiveX control in Design Mode i.e
I placed a ActiveX control on the DialogBox, now i want to draw something on the control . How can i do this ?
Any help...
Thank you.
|
|
|
|
|
Hi , win98 doesnt support unicode right?
so how can Wordpad.exe draw unicode chars in win98.
if i would like to do the same how would that be done?
the textout api just draws junk if i pass it a unicode string..
//Roger
|
|
|
|
|
fro win98, you need to use the unicows libraries.
see this :
unicows at MSDN[^]
There's also a newsgroup on microsoft news server on the subject..
Max.
|
|
|
|
|
I wrote a program that one could choose items from a toolbar and put them on the document by clicking left
button of mouse on the view. I considered a CRectTracker variable for each symbol and in the OnDraw function I
draw each symbol's tracker's rectangle.And for selecting each symbol which is shown on the page I check if the
position of left click of mouse is in the tracker of any of the symbols or not.
At the beginning I used CView class but now I want to use CScrollView in order that my program could support scrolling.I changed the base class of my view class to CScrollView and write some lines in its OnInitialUpdate in order to set the size of scrolling.Even I changed coordinates with CDC::DPtoLP function.
Now I scroll my program but when I put an item on the page and scroll the page , in some places that my item doesn't
exist , it seems that its tracker exists .
Thanks
Azadeh
|
|
|
|