|
I believe CPallini is right with it, but you could maybe try handing WM_CTLCOLORDLG[^] and try to select a bold font into the DC you get as parameter, no idea if it would work or not, but maybe it is worth a try.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
You can make your own messagebox.
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 )
|
|
|
|
|
Yeah ,its an option....
Regards,
Sunil Kumar
|
|
|
|
|
The answer to your question is a simple No.
But you can a) roll your own messagebox-a-like, and there are plenty in the dialogs section of codeproject.
or b) if you're on vista, use a Task Dialog (see http://blogs.chimpswithkeyboards.com/jonshute/archive/2006/11/26/230.aspx[^] for an article about it)
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
I am upgrading my VC6 app to new mfc feature pack, I have to add a CMFCMenuBar on a dialog box, I am able to add and display the menu bar, but none of its pop up menu items work.... All the menu items in dropdwn/popup menu in menu bar are disabled and not responding to any message... after adding message handler functions, anybody has any idea?? I am posting my code to create and display menubar (CMFCMenuBar) on a dialog box here. I have tried to put this code within OnInitDialog() as well as OnCreate() function of the dialog class.
m_wndMenuBar is a CMFCMenuBar object decleraed in .h file.
if (!m_wndMenuBar.Create(this))
{
TRACE0("Failed to create menubar\n");
return -1; // fail to create
}
CMenu *menu = new CMenu();
menu -> LoadMenu (IDR_ITEM_MENU);
m_wndMenuBar.CreateFromMenu(menu->GetSafeHmenu(),TRUE,TRUE);
m_wndMenuBar.SetDefaultMenuResId(IDR_ITEM_MENU);
m_wndMenuBar.SetWindowPos(NULL,0, 0 ,500,30,SWP_SHOWWINDOW);
Never complain,never explain,just do your work.
|
|
|
|
|
I have the same problem.Have you solved it?
|
|
|
|
|
Hi all,
when we press key Window+D than desktp is displayed.
i mean Window+D use for show desktop,here all opened applications are minimized.
how can chk wnd+D press.
please help me for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
You handle it by letting windows do the work.
You wouldn't think you know more about a user's needs than they do, would you?
----
OK, If you're running some sort of kiosk application, I can see how you might want to do something about it. But in that case, I think you can disable a lot of this stuff from within control panel / policies. (gpedit.msc from memory)
----
Just imagine if any program could say "sod you, I'm going to override the user's preferences and stay up all the time. Nerr". To misquote myself, do you think EvilProgram(tm).exe will say "no, I won't leave my 'buy personal enhancement drugs' advertisement on the screen... that would be rude"...
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Iain Clarke wrote: EvilProgram(tm).exe
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Well, it would be dishonest of them to call it ImAGoodProgramHonestIAm.exe.
That would shock my trust in humanity!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Capture WM_KEYDOWN msg in PreTranslateMessage use Virtual Key Code to determine the required combination.
Check this.
BOOL CDlg::PreTranslateMessage(MSG* pMsg)
{
switch(pMsg->message)
{
case WM_KEYDOWN:
{
if( (GetKeyState(VK_LWIN)||GetKeyState(VK_RWIN)) &&
(pMsg->wParam == 0x44)
)
{
}
}
}
}
|
|
|
|
|
Its not working.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What exactly is failing?
It should work coz I too have used this technique in my code so many times.
|
|
|
|
|
PreTranslateMessage(MSG* pMsg) function calls when Wnd key pressed its not handel both keys together thats why its not working.
please tell me solution for this.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi all,
I have a project, need to use MFC VC++ program called other application. How can i get the return value from the application?
My CreateProcess code was shown below:
void CProcessDlg::OnBnClickedButton1()
{
STARTUPINFO si;
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof( STARTUPINFO );
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
PROCESS_INFORMATION pi;
CreateProcess(NULL, "c://a//0.exe", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi);
}
eg.
ABC.exe will return "2" after it finished, how can my MFC VC++ program read the number "2"?
thanks.
|
|
|
|
|
|
Can you more explain what do you need exactly?
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 )
|
|
|
|
|
thanks a lot. i am able to read the return value by add-in the below script.
[CODE]
WaitForSingleObject(pi.hThread,INFINITE);
GetExitCodeProcess(pi.hProcess,&ExitCode);
[/CODE]
|
|
|
|
|
hi. i think this might help someone further in my problem i debug the code and it was nt able to make another view. it crashes here
CWnd* pView = (CWnd*)pContext->m_pNewViewClass->CreateObject();
i dnt why its nt able to make a new CFormView as the dialog it needed give is correct.
same files for new SDI application(doc view frame) i have tested in my new sample application.
they works fine
|
|
|
|
|
Do you know about a fantastic tool named debugger?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
|
Hi
I run this code and the result is different from expecting. This is the smoothing image convolution with Gauss mask, the result is 3 images overlapping each other in spite of smoothing image.
I do not know where I'm wrong. May be the size of image is not correct. The image is a binary image,resolution 190*243 and there are 5 byte header. You may want to try the image
http://edventure.ntu.edu.sg/bbcswebd...50016/leaf.raw [^]
Thank you very much.
<br />
#include <br />
#include <br />
#include <br />
using namespace std;<br />
int main (void) {<br />
FILE * in_file;FILE * out_file;<br />
<br />
int image[190][245];<br />
<br />
<br />
int read_size, write_size;<br />
int image_size=46175;<br />
<br />
in_file = fopen("leaf.raw", "rb");<br />
if(in_file == NULL) {<br />
fprintf(stderr,"Could not open file \n");<br />
exit(1);<br />
}<br />
<br />
read_size = fread(image, 1, image_size, in_file);<br />
if (read_size != image_size) {<br />
fprintf(stderr, "Reading error");<br />
exit(2);<br />
}<br />
<br />
out_file = fopen("newleaf.raw", "wb");<br />
if(out_file == NULL) {<br />
fprintf(stderr,"Could not open file \n");<br />
exit(3);<br />
}<br />
<br />
write_size = fwrite(image, 1, image_size, out_file);<br />
if (write_size != image_size) {<br />
fprintf(stderr, "Reading error");<br />
exit(4);<br />
}<br />
<br />
<br />
<br />
<br />
int mask [3][3];<br />
int IconvG [190][245];<br />
<br />
mask[0][0]=1;mask[0][1]=2;mask[0][2]=1;<br />
mask[1][0]=2;mask[1][1]=3;mask[1][2]=2;<br />
mask[2][0]=1;mask[2][1]=2;mask[2][2]=1;<br />
<br />
int m,n,u,v,sum,i,j;<br />
int kCols =3, kRows =3, rows = 190, cols = 245 ,mm,nn,ii,jj;<br />
int kCenterX = kCols / 2;<br />
int kCenterY = kRows / 2;<br />
<br />
for(i=0; i < rows; ++i)
{<br />
for(j=0; j < cols; ++j)
{<br />
sum = 0;
<br />
for(m=0; m < kRows; ++m)
{<br />
mm = kRows - 1 - m;
<br />
for(n=0; n < kCols; ++n)
{<br />
nn = kCols - 1 - n;
<br />
ii = i + (m - kCenterY);<br />
jj = j + (n - kCenterX);<br />
<br />
if( ii >= 0 && ii < rows && jj >= 0 && jj < cols )<br />
IconvG[i][j] += image[ii][jj] * mask[mm][nn];<br />
}<br />
}<br />
}<br />
}<br />
<br />
out_file = fopen("newleaf.raw", "wb");<br />
if(out_file == NULL) {<br />
fprintf(stderr,"Could not open file \n");<br />
exit(3);<br />
}<br />
<br />
write_size = fwrite(IconvG, 1, image_size, out_file);<br />
if (write_size != image_size) {<br />
fprintf(stderr, "Reading error");<br />
exit(4);<br />
}<br />
<br />
<br />
cout<<"done\n";<br />
fclose(in_file);<br />
fclose(out_file);<br />
return 0;<br />
}<br />
|
|
|
|
|
is there any event for system date change?
|
|
|
|
|
Do you need to SetSystemTime ?
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 )
|
|
|
|
|