|
You need to see how MFC function CWnd::CenterWindow is impplemeted. Step through that function while debugging and see how it is implemented.
|
|
|
|
|
I have a small program that is written on Borland C++ 3.1, it worked probarly on Win98 but now I need to reuse this program on WinXP, howerver there is an error when i use it on WinXp. Any body know to convert this program into Win32 application. What is bios.h header file. Could I rewrite a new application and then aopy these code again?
|
|
|
|
|
The problem is that functions defined in the ‘bios.h’ (equivalent to MS ‘dos.h’) header file are used to access low level bios functionality (indirect assembly code). In other words, it is designed to talk to the computer at the bios (or machine) level. These functions usually need to be replaced with equivalent Win32 functions that you may need to write yourself. I know that there is a [free] driver on the Net that allows you to access this level (ring 0), because I have used it, but I do not remember what it is called.
Kiethnt wrote: Could I rewrite a new application and then aopy these code again?
Well yes and no, in either case you will need to recompile the code and look at the errors (or warnings) and figure out how to do the equivalent in Win32
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hello,
I am trying to extract data from an application with a sharedmem, however the function call to OpenFileMapping requires that I have the name of the file mapping object which I don’t have.
Is there some way that I can find the name of the available file mapping object for this application?
|
|
|
|
|
No, there isn't. The other application may have created multiple file-mapping objects, each with or without a name. If it's a named file-mapping object, that name has to be unique within the application. I *think* you can create multiple unnamed file-mapping objects.
Best,
Jun
|
|
|
|
|
way to change the backcolor of radio button in MFC
|
|
|
|
|
Please see this[^]
PS: I have sent your previous message[^]to spam.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
|
Did you see my answer and did you try it and same question not helpfuls.
|
|
|
|
|
|
|
I want to handle the ESCAPE key in certain situation; I try to catch it in PreTranslateMessage with WM_KEYUP.
Pressing ESCAPE leads always to the "cancel" result.
If I have a control named IDCANCEL, the OnClicked handler receives the control, whenever
ESACPE has been pressed, but I can not differentiate between clicking on that control
and the "true ESCAPE".
Is there a way I can separate the "escape" key from the CANCEL button and from "exit" ("X" in the system menu)?
Actually, I need it in a CEdit control.
|
|
|
|
|
Refer this[^].
Similarly, use VK_RETURN for enter key.
|
|
|
|
|
Thanks, it works with KEYDOWN
|
|
|
|
|
Give the button a different ID and a new handler for this ID, than it should work.
To catch up ESCAPE you need to catch the WM_KEYDOWN Event.
But it is important where the PreTranslateMessage.
Try to catch the WM_KEYDOWN event in your Dialog class.
|
|
|
|
|
how to change the background color of the radio button to be same as window color
|
|
|
|
|
See
HBRUSH CDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetTextColor(RGB(20,120,220));
pDC->SetBkColor(RGB(20,120,220));
return hbr;
}
|
|
|
|
|
how to handle this OnCtlColor class and to set the background color
i think will not work for buttons. it chnages only the static label background.
-- modified at 4:36 Saturday 3rd March, 2007
|
|
|
|
|
You must insert WM_CTLCOLOR message to your program and for radio button its working and again a short help
BEGIN_MESSAGE_MAP(CDialogDlg, CDialog)
ON_WM_CTLCOLOR()
END_MESSAGE_MAP()
HBRUSH CDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkColor(RGB(20,120,220));
pDC->SetTextColor(RGB(255,255,220));
return hbr;
}
public:
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
|
|
|
|
thank you very much its working well.
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi,
I want to switch from 5 window splitter to 3 window, using the same object of CSplitterwnd, is it possible for me to reintialise or recreate the same object of CSplitterwnd, so that i can change the number of rows and columns in the same application.
|
|
|
|
|
Are you trying to do this at runtime?
|
|
|
|
|
Yes, i want to do it Run time when i will click on certain button.
|
|
|
|
|
Hello everybody!
Is there any specific way to run an exe when a system wants to logoff!
Or will the system forcefully closes all active applications before logoff?
|
|
|
|