|
Dominik Reichl wrote:
And if I don't want to have a status bar?
Try this:
Declare in MyDialog.h:
CScrollBar m_Grip;
in CMyDialog::OnInitDialog:
CRect rect;
GetClientRect(rect);
rect.left = rect.right - 10;
rect.top = rect.bottom - 10;
m_Grip.Create(WS_CHILD | SBS_SIZEBOX | SBS_SIZEBOXBOTTOMRIGHTALIGN |
SBS_SIZEGRIP | WS_VISIBLE, rect, this, AFX_IDW_SIZE_BOX);
in CMyDialog::OnSize:
CWnd *pGripper = GetDlgItem(AFX_IDW_SIZE_BOX);
if (pGripper)
{
CRect rectGripper, rectClient;
pGripper->GetWindowRect(&rectGripper);
GetClientRect(rectClient);
rectClient.left = rectClient.right - rectGripper.Width();
rectClient.top = rectClient.bottom - rectGripper.Height();
pGripper->MoveWindow(&rectClient);
}
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Ahh, wonderful! Just one more question: is the size of a gripper always 10? Independent of how big statusbars and scrollbars are?
Thanks!!!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Dominik Reichl wrote:
is the size of a gripper always 10?
No. Windows will size the gripper to whatever the system default is. You can actually replace 10 with anything (or just remove it), and it would probably work ok.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Dominik Reichl wrote:
And if I don't want to have a status bar?
I assume you mean you don't want the status bar to look like a status bar (and not that you're averse to using a CStatusBar object).
You can restrict the width of the status bar to that of the sizer grip, so that it doesn't interfere with controls in your dialog, as in the standard Win2K "File Open" dialog for an example.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Yes, I've done this now!
Many thanks!!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi i have a dialog based app and im trying to add a tray icon i can get the icon to display but whenever you move the mouse into the tray it dissapears here is the code i have for it
niData is stored in the class and is zeroed in the constructor
void CWinDEDlg::InitTrayIcon()
{
niData.cbSize = sizeof(NOTIFYICONDATA);
niData.uID = TRAY_ID;
niData.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
niData.hIcon = (HICON)m_hIcon;
niData.hWnd = (HWND)this;
niData.uCallbackMessage = ICON_MESSAGE;
Shell_NotifyIcon(NIM_ADD, &niData);
}
does anyone know why the icon just dissapears?
|
|
|
|
|
I'm guessing it's because you've given the shell a zero length tooltip. Try removing the NIF_TIP
flag. Though windows should just "shrug" and move on...
Do you have a handler for ICON_MESSAGE? If so, does it get called before the icon disappears?
Is your m_hIcon still valid?
Iain.
|
|
|
|
|
//Toolbar m_wndtoolbar
// m_wndtoolbar is a public dialog member variable
//follow is my app para ,But it failed to change toolbar
void CToolbarDlg::OnButton ShowToolBar1()
{
// TODO: Add your control notification handler code here
if (m_wndtoolbar.GetSafeHwnd())
{
m_wndtoolbar.DestroyWindow();
}
if (!m_wndtoolbar.CreateEx( this,TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS ,
CRect(4,4,0,0)) || !m_wndtoolbar.LoadToolBar(IDR_TOOLBAR1) )
{
TRACE0("failed to create toolbar\n");
return;
}
m_wndtoolbar.ShowWindow(SW_SHOW);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
}
void CToolbarDlg::OnButtonShowToolBar2()
{
// TODO: Add your control notification handler code here
if (m_wndtoolbar.GetSafeHwnd())
{
m_wndtoolbar.DestroyWindow();
}
if (!m_wndtoolbar.CreateEx( this,TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS ,
CRect(4,4,0,0)) || !m_wndtoolbar.LoadToolBar(IDR_TOOLBAR2) )
{
TRACE0("failed to create toolbar\n");
return;
}
m_wndtoolbar.ShowWindow(SW_SHOW);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);
}
|
|
|
|
|
I have dialog based MFC application.
How to create scrollable child dialog window (placed in main dialog window),containing control elements ?
Thank you
rrrado
|
|
|
|
|
Its a bit convoluted, but I've done this in the past.
Created a main dialog with some controls on it. The two relevant ones were a scroll control, and
a large static control.
In the OnInitDialog, I replaced the static control with a same size but very plain (no title etc)
dialog. In THAT dialog, I created the scrollable one, which was larger. I then got the relevant sizes
and initialised the scroll bar.
I handled the WM_VSCROLL messages (it was only large in one direction, but the principle is the same
two ways) and moved the large grandchild dialog. The child dialog acted to clip it.
I also had to disable non-visible controls on the scrollable dialog as the user was able to tab to
non-visible controls. Not too good. I never got PgUp / PgDown hooked into scrolling the dialog.
But to this day, no user has spotted that lack!
Iain.
|
|
|
|
|
Thank for the idea
I'd like to find not so complicated solution, if unsuccessful, I'll
try to use your solution
I tried just to enable scroll bar on dialog (ShowScrollBar(SB_VERT , TRUE );)
but i can't set proper size get it working ....
rrrado
|
|
|
|
|
I've found article abut it here, I'm gonna look at it
http://www.codeproject.com/dialog/scrollablechilddialog.asp
|
|
|
|
|
I added a scroll ctrl as its own self. That way I could line up with the scrolling dialog, rather
than at the edge of the parent.
Iain,
|
|
|
|
|
Hi
I want to make a demo (presentation) of a VC++ program i have written.
I used this program:
http://www.turbodemo.com/Eng/index.htm
but because it is trial, i can't add alot of screenshots.
Does anyone know a good program which can make a demo (in for example .exe or .swf format) and is free to use? (no registration)
I would GREATLY appreciate any comments on this one, i've been searching on the web like hell but i can't seem to find one working properly without having to be registered. :S
Greetings
Jens
|
|
|
|
|
It may be complete overkill, but OpenOffice has a powerpoint-style presentation program, and its free.
|
|
|
|
|
Hi,
I wont read/write a compact flash use LBA mode(without filesystem), but I don't know it.
Thank you
Paolo
|
|
|
|
|
Hey there,
I've got a problem with overlapping a full-screen DirectX window. Some customers of ours have some presentation software running. This software runs in a full-screen DX window.
Now we need to have a numbering system -on top- of this presentation window whilst the presentation keeps on running.
It is possible... on some places we have a pinnacle tv card it's software running on top of the screen. I've been asking around and I was told Pinnacle's TV card software uses DX as well and that you can only overlap a DX window with another DX window.
Anyways, I started building some of the DX examples (I'm still fairly new to C++, not to mention VC++, let be DX) and executed those, however they fail with a general error (if the presentation software is running, if the presentation software is not running these apps run fine).
My best guess would be that the software fails, because the presentation software has the 3D device and the samples are trying to create a new one.
What I need is some pointers, I have no clue on where to look, or what windowing API's I need to use to overlap the DX full-screen window. Perhaps I'm just missing some flag I have to set on the DX sample windows...
Any help would be greatly appreciated. In principal all I need is a lil screen, preferably without the blue bar on top nor the menu's, that displays a number whilst overlapping a full-screen DX window, the overlapping being the main concern.
For the curious, the number screen app would listen on a com-port to a button, if the button is pressed the number gets incremented by one. It's use is for a bakkery where you have to wait for your number to get up, whilst there's a presentation running in the background.
Thanks in advance
|
|
|
|
|
The problem will almost certainly lie in the fullscreen mode which is probably reserved exclusively for that app. Any other app that tries to go on top will be stuffed cos the whole screen is reserved for one app.
|
|
|
|
|
I implemented drag&drop feature in my application. In OnCreate() of the CView-derived class, I registered the drop target object. Like this.
COleDropTarget m_DropTarget; // in the header file of CView-derived class
m_DropTarget.Register(this); // in the implementation file of CView-derived class
It works well in my development PC but it doesn't work in the other PCs. I checked the related DLL file(ole32.dll in System32 directory) but I couldn't find the reason. Please let me know why the function fails.
|
|
|
|
|
Hi,
I want to invoke the virus scanner for some files programmatically. Do some of the leading anti-virus(like McAfee or Norton) scanners provide any APIs for performing such task? How do I invoke virus scanners to scan for a particular file based on a application's need.
Thanks.
Learning is a never ending process of Life.
|
|
|
|
|
I have used 3 different help authoring tools and after doing my help file development my resultant help file displays all of the topics for Internet Explorer!
Does anyone know what is going on?!?!
|
|
|
|
|
Hi,
I have a web browser control, I have added the WS_CLIPCHILDREN style to my CFormView and the "normal" flickering isnt there.
Now the problem is I am trying to resize the web browser control OnSize of CFormView and it flickers during that, I have tried all possible combinations to no avail (The WS_CLIPCHILDREN style is set, this is when the web browser control is resized *WITH* the CFormView class)
quote:
--------------------------------------------------------------------------------
void CMyFormView::OnSize(UINT nType, int cx, int cy)
{
ModifyStyle(0, WS_CLIPCHILDREN);
CFormView::OnSize(nType, cx, cy);
if (IsWindow(m_webbrowser.GetSafeHwnd())) {
m_webbrowser.MoveWindow(0,0,cx,cy, FALSE);
}
// TODO: Add your message handler code here
}
--------------------------------------------------------------------------------
Any idea how to stop this behaviour?
Thanks in advance!
|
|
|
|
|
Hi Everyone,
I have generated a MDI program and have been running it overnight to test its robustness. But I have a problem here. It seems that the whole program would sometimes disappear. I wonder if there is any memory problem or thread gone missing. Hope that anyone can enlighten me. Thanks.
|
|
|
|
|
Run it in the debugger and see where it crashes.
John
|
|
|
|
|
Erm I had tried that but it only disappears when it is doing a continuous run and just like a time bomb yoo don't know when it will happens.
|
|
|
|