Click here to Skip to main content
15,902,802 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to inject a dll into another process ? Pin
ThatsAlok4-Mar-08 20:39
ThatsAlok4-Mar-08 20:39 
GeneralProgress bar on Mainfram, while lengthy prosses on Dialog btn press event Pin
ptr_Electron4-Mar-08 2:49
ptr_Electron4-Mar-08 2:49 
GeneralRe: Progress bar on Mainfram, while lengthy prosses on Dialog btn press event Pin
David Crow4-Mar-08 3:20
David Crow4-Mar-08 3:20 
GeneralRe: Progress bar on Mainfram, while lengthy prosses on Dialog btn press event Pin
ptr_Electron4-Mar-08 3:37
ptr_Electron4-Mar-08 3:37 
GeneralRe: Progress bar on Mainfram, while lengthy prosses on Dialog btn press event Pin
David Crow4-Mar-08 3:48
David Crow4-Mar-08 3:48 
GeneralRe: Progress bar on Mainfram, while lengthy prosses on Dialog btn press event Pin
Randor 4-Mar-08 4:02
professional Randor 4-Mar-08 4:02 
GeneralProblem in property sheet.. Pin
Ashish Chauhan4-Mar-08 2:06
Ashish Chauhan4-Mar-08 2:06 
AnswerRe: Problem in property sheet.. Pin
Rajkumar R4-Mar-08 4:59
Rajkumar R4-Mar-08 4:59 
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);
}
}
GeneralRe: Problem in property sheet.. Pin
Maxwell Chen4-Mar-08 18:29
Maxwell Chen4-Mar-08 18:29 
GeneralRe: Problem in property sheet.. Pin
Ashish Chauhan4-Mar-08 18:41
Ashish Chauhan4-Mar-08 18:41 
GeneralRe: Problem in property sheet.. Pin
ThatsAlok4-Mar-08 20:40
ThatsAlok4-Mar-08 20:40 
GeneralRe: Problem in property sheet.. Pin
toxcct4-Mar-08 9:58
toxcct4-Mar-08 9:58 
GeneralRe: Problem in property sheet.. Pin
ThatsAlok4-Mar-08 20:40
ThatsAlok4-Mar-08 20:40 
Questionhow to add an image in the form in vc++?? Pin
savitri4-Mar-08 1:15
savitri4-Mar-08 1:15 
GeneralRe: how to add an image in the form in vc++?? Pin
jossion4-Mar-08 1:24
jossion4-Mar-08 1:24 
GeneralRe: how to add an image in the form in vc++?? Pin
Hamid_RT4-Mar-08 4:21
Hamid_RT4-Mar-08 4:21 
AnswerRe: how to add an image in the form in vc++?? [modified] Pin
Rajkumar R4-Mar-08 1:31
Rajkumar R4-Mar-08 1:31 
GeneralRe: how to add an image in the form in vc++?? Pin
Hamid_RT4-Mar-08 4:20
Hamid_RT4-Mar-08 4:20 
GeneralMessage Pass Pin
john56324-Mar-08 0:42
john56324-Mar-08 0:42 
GeneralRe: Message Pass Pin
CPallini4-Mar-08 0:53
mveCPallini4-Mar-08 0:53 
GeneralRe: Message Pass Pin
Mark Salsbery4-Mar-08 5:29
Mark Salsbery4-Mar-08 5:29 
GeneralRe: Message Pass Pin
ThatsAlok4-Mar-08 20:41
ThatsAlok4-Mar-08 20:41 
Generalerror C2440 Pin
neha.agarwal273-Mar-08 23:58
neha.agarwal273-Mar-08 23:58 
AnswerRe: error C2440 Pin
Rajkumar R4-Mar-08 0:10
Rajkumar R4-Mar-08 0:10 
GeneralRe: error C2440 Pin
CPallini4-Mar-08 0:14
mveCPallini4-Mar-08 0:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.