Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWindows update install wua api for client server Pin
ashish8patil23-Jun-09 21:57
ashish8patil23-Jun-09 21:57 
QuestionWindows message, Pin
birajendu23-Jun-09 20:52
birajendu23-Jun-09 20:52 
AnswerRe: Windows message, Pin
Stuart Dootson23-Jun-09 21:40
professionalStuart Dootson23-Jun-09 21:40 
GeneralRe: Windows message, Pin
birajendu23-Jun-09 22:21
birajendu23-Jun-09 22:21 
GeneralRe: Windows message, Pin
«_Superman_»23-Jun-09 22:23
professional«_Superman_»23-Jun-09 22:23 
GeneralRe: Windows message, Pin
birajendu23-Jun-09 22:47
birajendu23-Jun-09 22:47 
GeneralRe: Windows message, Pin
Stuart Dootson23-Jun-09 23:05
professionalStuart Dootson23-Jun-09 23:05 
GeneralRe: Windows message, Pin
Stuart Dootson23-Jun-09 23:02
professionalStuart Dootson23-Jun-09 23:02 
The message loop will handle all windows created on the thread it's in (a simplification, but close enough).

To modify the behaviour of the child windows, you need to subclass them, to handle messages sent to them differently than the default. I would suggest you read up about window subclassing - this[^] is a good starting point.

For example, to subclass a tab control created in your topmost window, you might use this to create and then subclass the control.

RECT rcCLient;
GetClientRect(hWnd, &rcCLient);
hwndTab = CreateWindow(WC_TABCONTROL, _T("tab"), WS_VISIBLE|WS_CHILDWINDOW, 0, 0, rcCLient.right, rcCLient.bottom, hWnd, 0, hInst, 0);
oldTabProc = (WNDPROC)::SetWindowLongPtr(hwndTab, GWLP_WNDPROC, LONG_PTR(&TabWndProc));


This next code fragment is my definition of a window procedure for the tab control that will forward notifications from an edit control contained inside it to the tab control's parent window. It's a bit evil, 'cause it uses a global for the tab control's old WNDPROC, but it illustrates the point.

WNDPROC oldTabProc;
LRESULT CALLBACK TabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   if (message == WM_COMMAND && HWND(lParam) == hwndEdit)
      return ::SendMessage(GetParent(hWnd), message, wParam, lParam);
   return oldTabProc(hWnd, message, wParam, lParam);
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Windows message, Pin
birajendu24-Jun-09 1:30
birajendu24-Jun-09 1:30 
QuestionHow to redirect Telnet and Ftp in windows Pin
ssm198411923-Jun-09 20:03
ssm198411923-Jun-09 20:03 
AnswerRe: How to redirect Telnet and Ftp in windows Pin
Stuart Dootson23-Jun-09 21:37
professionalStuart Dootson23-Jun-09 21:37 
GeneralRe: How to redirect Telnet and Ftp in windows Pin
ssm198411924-Jun-09 3:02
ssm198411924-Jun-09 3:02 
GeneralRe: How to redirect Telnet and Ftp in windows Pin
Stuart Dootson24-Jun-09 3:08
professionalStuart Dootson24-Jun-09 3:08 
QuestionGetActiveWindow Pin
prithaa23-Jun-09 19:15
prithaa23-Jun-09 19:15 
AnswerRe: GetActiveWindow Pin
Naveen23-Jun-09 20:02
Naveen23-Jun-09 20:02 
GeneralRe: GetActiveWindow Pin
prithaa24-Jun-09 1:53
prithaa24-Jun-09 1:53 
Questionconvert wchar to CString& Pin
Rakesh523-Jun-09 18:59
Rakesh523-Jun-09 18:59 
AnswerRe: convert wchar to CString& Pin
«_Superman_»23-Jun-09 19:21
professional«_Superman_»23-Jun-09 19:21 
GeneralRe: convert wchar to CString& Pin
Rakesh523-Jun-09 19:36
Rakesh523-Jun-09 19:36 
GeneralRe: convert wchar to CString& Pin
Cedric Moonen23-Jun-09 20:10
Cedric Moonen23-Jun-09 20:10 
GeneralRe: convert wchar to CString& Pin
Rajesh R Subramanian23-Jun-09 20:13
professionalRajesh R Subramanian23-Jun-09 20:13 
AnswerRe: convert wchar to CString& Pin
Cedric Moonen23-Jun-09 20:07
Cedric Moonen23-Jun-09 20:07 
GeneralRe: convert wchar to CString& Pin
Rakesh523-Jun-09 20:20
Rakesh523-Jun-09 20:20 
AnswerRe: convert wchar to CString& Pin
Rajesh R Subramanian23-Jun-09 20:12
professionalRajesh R Subramanian23-Jun-09 20:12 
QuestionTabbed control from Win 32 Pin
birajendu23-Jun-09 18:05
birajendu23-Jun-09 18:05 

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.