|
Ashish Chauhan wrote: case WM_NOTIFY: lpnmhdr = (NMHDR*)lParam; switch (lpnmhdr->code) { case PSN_APPLY: break; case PSN_RESET: PostQuitMessage(0); break; case PSN_SETACTIVE: return 1; case PSN_KILLACTIVE: return FALSE; } //break;
Your Dialog Proc for Property page is not returning the values to the property sheet handler. To set the return value, the dialog box procedure for the page must call the SetWindowLong function with the DWL_MSGRESULT value, and the dialog box procedure must return TRUE.
try the following,
case WM_NOTIFY:
lpnmhdr = (NMHDR*)lParam;
switch (lpnmhdr->code)
{
case PSN_APPLY:
SetWindowLong(hdlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
return TRUE;
case PSN_SETACTIVE:
SetWindowLong(hdlg, DWL_MSGRESULT, 0);
return TRUE;
case PSN_KILLACTIVE:
SetWindowLong(hdlg, DWL_MSGRESULT, FALSE);
return TRUE;
}
just for checking purpose try the above, read msdn for each Notification and write accordingly.
And also message loop has to check for OK cancel part. read msdn for PropSheet_GetCurrentPageHwnd also.
while (GetMessage(&msg, NULL, 0, 0))
{
if(PropSheet_IsDialogMessage(g_hwndPropSheet, &msg))
{
if (!PropSheet_GetCurrentPageHwnd(g_hwndPropSheet))
{
DestroyWindow(g_hwndPropSheet);
PostQuitMessage(0);
}
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
|
|
|
|
|
You got my 5 for your patience!
Maxwell Chen
|
|
|
|
|
Thanks rajkumar...
Thanks a ton...
It works now...
Thanks again...
Ash..
|
|
|
|
|
yeah, i too agree with maxwell, 5 from my side too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
|
toxcct wrote:
come on tox! don't sleep!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
hi Experts,
i am again asking u all to one more problem. in the i add picture box but i didnt know how to add the image and what code should i add to show image when i execute that program
thanku one and all,
regards,
savitri,
|
|
|
|
|
In visual C project (MFC type) go to insert menu and select bitmap option. Browse for your picture file and add it.Under resources tab in the project navigator check the ID of the bitmap file. Then under OnPaint() function add this piece of code.
CPaintDC dc(this);
CBitmap bmp , *poldBmp;
CDC memdc;
bmp.LoadBitmap(IDB_BITMAP1); // IDB_BITMAP1 is the ID of the bitmap loaded
mdmdc.CreateCOmpatibleDC(&dc);
poldBmp= memdc.SelectObject(&bmp);
dc.BitBlt(10,10,47,47,&memdc,0,0,SRCCOPY);
memdc.SelectObject(poldBmp);
//Do not call CDialog::Onpaint() for painting
|
|
|
|
|
I think he wants to insert a image to a control(maybe static control or no).
|
|
|
|
|
savitri wrote: in the i add picture box but i didnt know how to add the image and what code should i add to show image when i execute that program
I think you are looking for Win forms help. Then I think this is not the message board, you have dedicated message board for WF.
Anyway, right click the picture box you have "Choose Image" option in the context menu. Or go to the property View and Image Option has the field to set the Image.
And if you looking for Picture Control in win32/MFC, in the property view, set the type of picture control to Bitmap, and specify the ID of the bitmap resource in the Image field
modified on Tuesday, March 4, 2008 7:47 AM
|
|
|
|
|
You can use of this code for insert image to your control.
#include AtlImage.h
CImage m;
m.Load(_T("c:\\1.jpg"));
m_Control.SetBitmap(m_.detach());
|
|
|
|
|
Hi Experts,
How can I pass a message from dll application to other application?
|
|
|
|
|
With PostMessage , of course.
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
|
|
|
|
|
What's a "dll application"?
We deal in "processes" here
Do you need to pass a message from one process to another?
If so... Interprocess Communications[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
pther wrote:
How can I pass a message from dll application to other application?
have you dll has any window, or it just one way communication!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hi all,
I am writing this code in VC 2005
TCHAR szPath[MAX_PATH];
CStdioFile sys_file_ptr;
GetModuleFileName(NULL,szPath, MAX_PATH);
PathRemoveFileSpec(szPath);
suppose file is located at this path
szPath = C:\New Folder\new.exe
and after using PathRemoveFileSpec() API i am getting this result
szPath = C:\New Folder
i want to add a slash at the end of the string. i do it using this code
szPath = szPath + _T('\\');
it gives error
error C2440: '=' : cannot convert from 'TCHAR *' to 'TCHAR [260]'
i have tried strcat()also but it also gives some error.
somebody can tell me how to do this......
|
|
|
|
|
neha.agarwal27 wrote: error C2440: '=' : cannot convert from 'TCHAR *' to 'TCHAR [260]'
i have tried strcat()also but it also gives some error.
use _tcscat() inplace of strcat, as you are using generic text data type.
|
|
|
|
|
You cannot do string concatenation that way with a character array. you must go on with a C-like approach:
_tcscat(szPath, _T("\\"));
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
|
|
|
|
|
neha.agarwal27 wrote:
i want to add a slash at the end of the string. i do it using this code
szPath = szPath + _T('\\');
Aside from that being syntactically wrong, why not just use PathAddBackslash() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi everybody!
In a project I am working on I have a modal dialog and I would like to show an other modeless dialog by clicking on a button.
The modeless dialog is created before the DoModal is called, and therefore after clicking on the button (only ShowWindow(SW_SHOW) ) the modeless dialog it will appear, but I can't click on it, because it has no focus.
Have anybody an idea how can be solved this problem?
Thanks in forward.
|
|
|
|
|
potyex wrote: The modeless dialog is created before the DoModal is called, and therefore after clicking on the button (only ShowWindow(SW_SHOW) ) the modeless dialog it will appear, but I can't click on it, because it has no focus.
that is the behavior of Modal Dialog, the user cannot interact with other windows until the dialog box is closed, then you have to go for Modeless dialog instead.
|
|
|
|
|
Why not create and show the modeless dialog after the button is clicked?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Because is too late to create after button click. I have to communicate with that dialog, it is alive (but not visible) durring the project run.
|
|
|
|
|
How can I have my application always in top
|
|
|
|
|
what about,
SetWindowPos(hWndApplication, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
modified on Tuesday, March 4, 2008 6:59 AM
|
|
|
|