|
|
For show avi files you can see Nuri Ismail's answer although you can use of MCI functions,for moving images you can make a timer and then you can move images.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
hai friend's
I want to Communicate with Ms Access using MFC Application , I don't Know Ms Access...
But Am Working in SQL with MFC
Please Help Me How to Insert ,Delete ,Update in Ms access...give some code plz thank u... Regard'sMathy's
|
|
|
|
|
|
|
Hi All
Can i set or use Check box on messageBox?Plz advice me
|
|
|
|
|
|
Hi,
How can send a message to a running application from another running application.
I tried with FindWindow(), to find the window and PostMessage() to it.
But somtimes FindWindow() is not able to figure out the desired window.
I think I have to use the registred class name instead of Window Name...
So please tell me how to do that..
My app is SDI(VS 2003). And window registration code is
<br />
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
if( !CFrameWnd::PreCreateWindow(cs) )<br />
return FALSE;<br />
<br />
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;<br />
cs.lpszClass = AfxRegisterWndClass(NULL,NULL,NULL,AfxGetApp()->LoadIcon(IDR_MAINFRAME));<br />
cs.style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;<br />
return TRUE;<br />
}<br />
<br />
But the AfxRegisterWndClass() return a window name that is like afx:0000:50000......
Is there any way to register the window with user defind name so that I can use this name with FindWindow().
|
|
|
|
|
You can use of EnumWindows it gives you a handle to each window and then you can use of ::SendMessage(hwnd,....);
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
If you are programming both applications, I recommend using named events.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I'm working on a standard Windows SDI application (with menu, toolbar etc.) written using the API ie. no MFC. Currently it has a quirk (though one shared by apps such as Visual Studio and UEStudio). Namely, if I run through the following steps...
1. Open a modal dialog box
2. Then activate another open application by clicking on its icon in the taskbar
3. Click anywhere in that app's window
4. Click on the taskbar icon for my application
... the modal dialog box appears but over the against the background of the other application. It's only when I close the dialog box that my application window re-appears. Any ideas?
Thanks in advance.
modified on Saturday, May 9, 2009 2:17 AM
|
|
|
|
|
I can't say that I see that behaviour (I followed your repro steps with Visual Studio and a couple of other apps). I would tend to say that if VS is acting like that, then your system's setup isn't quite right.
Also - if your app is acting like VS, it can't be doing too much wrong?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am trying to create a help file for my program. I wrote a pdf with pictures and text describing how my program works and I wanted to put a button called "help" on my dialog that would open the pdf. But doing this seems quite hard, could someone help me do this? I have tried just opening a blank dialog and adding Static Text but quite frankly I think that looks like crap. Maybe I am approaching the problem from the wrong angle. Is there some easier way to do this? Any help would be appreciated.
|
|
|
|
|
See WinHelp / HTMLHelp[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
xzing wrote: I am trying to create a help file for my program. I wrote a pdf with pictures and text describing how my program works and I wanted to put a button called "help" on my dialog that would open the pdf. But doing this seems quite hard, could someone help me do this? I have tried just opening a blank dialog and adding Static Text but quite frankly I think that looks like crap. Maybe I am approaching the problem from the wrong angle. Is there some easier way to do this? Any help would be appreciated.
If you already have a PDF with help information, you could just open the PDF file with ShellExecute and that'll open the PDF file in an external PDF viewer the same as a Windows help file would be opened in an external viewer.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I want to know how I can write text with backspace in a transparent window.
I am using this code but it does not work.
#include <afxwin.h>
//////////////////////////////////////////////////////////////////////////
// CMyFrameWnd
class CMyFrameWnd : public CFrameWnd
{
public:
CMyFrameWnd();
protected:
CString m_Text;
//{{AFX_MSG(CMyFrameWnd)
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CMyFrameWnd, CFrameWnd)
//{{AFX_MSG_MAP(CMyFrameWnd)
ON_WM_CHAR()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CMyFrameWnd::CMyFrameWnd()
{
//Transparent window
CString strMyClass=AfxRegisterWndClass( NULL, NULL, (HBRUSH) NULL);
Create(strMyClass, _T("Frame Window"));
}
void CMyFrameWnd::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
m_Text += nChar;
if (nChar == VK_BACK)
{
m_Text = m_Text.Left(m_Text.GetLength() - 2);
TRACE("\n%s", m_Text);
}
Invalidate();
}
void CMyFrameWnd::OnPaint()
{
CPaintDC dc (this);
dc.TextOut(0,0,m_Text);
}
//////////////////////////////////////////////////////////////////////////
class CMyApp : public CWinApp
{
public:
CMyApp(){};
virtual BOOL InitInstance();
};
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrameWnd();
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
CMyApp myApp;
If I use a normal window changing:
CString strMyClass=AfxRegisterWndClass( NULL, NULL, (HBRUSH) NULL);
Create(strMyClass, _T("Frame Window"));
to
Create(NULL, _T("Frame Window"));
backspace work well
Can you give me any idea
Thanks
|
|
|
|
|
It is working - it's just that with a NULL brush, the Invalidate call won't erase the characters you're backspacing over, as it paints over them with transparency.
Try entering the following text in the window - abc<backspace>d - you'll end up with abd after that, which shows that the backspace is being recognised.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Mr. Dootson:
Yes, I can see m_text contains "abc" after bakcspace but my transparent window shows "abcd". I need erase text or backspace draw in my transparent window. How can I do that? Do you have any idea?.
Thanks
|
|
|
|
|
Weird - the window displayed "abd" when I did that - and I used the same code as you - well, the only difference is how I created the window. I put your window class registration code in the PreCreateWindow method of my view:
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
cs.lpszClass=AfxRegisterWndClass( NULL, NULL, (HBRUSH) NULL);
return TRUE;
}
This method is called from within the CWnd::Create method, so should do much the same as your code?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Mr.Dootson:
I had added
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyFrameWnd)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
in my Class declarations and your PreCreateWindow code as
BOOL CMyFrameWnd::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
cs.lpszClass=AfxRegisterWndClass( NULL, NULL, (HBRUSH) NULL);
return TRUE;
}
How I have to change Create? I used:
Create(NULL, _T("Frame Window")) but it doesn't works.
I get and ASSERT in wincore.cpp Line:722
and there is not any text in my window. What >I am doing wrong?
Thanks
|
|
|
|
|
gcorrea wrote: How I have to change Create?
I don't call Create at all - the view window's created by my CMainFrame class, which in turn is created within my application classes InitInstance method.
So, slightly different class structure to yours.
In your app's InitInstance method, changing
m_pMainWnd = new CMyFrameWnd();
to
m_pMainWnd = new CMyFrameWnd();
m_pMainWnd->Create();
could probably work
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
When I do that I get error C2660: 'Create' : function does not take 0 parameters
|
|
|
|
|
So add in the necessary parameters!
My MainFrame class uses these parameters to create the view:
m_wndView.Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(0, 0, 0, 0), this, 0xE900, NULL);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Doing that I get: error C2664: 'Create' : cannot convert parameter 6 from 'const int' to 'const char *'
This is referring to 0xE900.
Do you think it is possible to send me your code to gcorrea@cguelectronics.com in order to evaluate?
Thanks
|
|
|
|
|
Again the different class thing gets in the way. How about you read the documentation for your frame window vs. CWnd - that'll show you how the parameters fit in.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|