Click here to Skip to main content
15,905,913 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: getting the email address from an outlook _MailItem Pin
BlackDice4-May-04 6:29
BlackDice4-May-04 6:29 
Generaljpg to bmp Pin
Qualvis4-May-04 5:10
Qualvis4-May-04 5:10 
GeneralRe: jpg to bmp Pin
jmkhael4-May-04 5:13
jmkhael4-May-04 5:13 
Questionis there a way to run programs with other programs? Pin
jetournier4-May-04 4:59
jetournier4-May-04 4:59 
AnswerRe: is there a way to run programs with other programs? Pin
jmkhael4-May-04 5:01
jmkhael4-May-04 5:01 
GeneralRe: is there a way to run programs with other programs? Pin
jetournier5-May-04 2:37
jetournier5-May-04 2:37 
GeneralRe: is there a way to run programs with other programs? Pin
jmkhael5-May-04 2:41
jmkhael5-May-04 2:41 
Generalcapturing message from app2 Pin
pnpfriend4-May-04 4:57
pnpfriend4-May-04 4:57 
Hello.. All
I have my application and the application 2. app2 sends the window messages and I don't know how to capture those messages. I'm using .Net c++ and the following example was provided by app2.
My application is Dialog-based application.. and I don't know how to convert the following code or capture the messages from other application at all.

The app2 said register a message ( could be anything) and my application also has to register the same message as app2. (that's I don't know how)
then app2 will start sending messages and my app has to capture and process those messages. ( I have no idea how to capture the messages either)
I kind of have the idea of GetMessage() as it is shown in the example. but how?

<br />
HINSTANCE			hInst;<br />
LRESULT CALLBACK	TestWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);<br />
<br />
int PASCAL WinMain(HINSTANCE hinstCurrent, HINSTANCE hinstPrevious, LPSTR lpszCmdLine, int nCmdShow)<br />
{<br />
 <br />
    WNDCLASS wc;<br />
<br />
    /* Register the window class. */<br />
    wc.style         = 0;<br />
    wc.lpfnWndProc   = TestWndProc;<br />
    wc.cbClsExtra    = 0;<br />
    wc.cbWndExtra    = 0;<br />
    wc.hInstance     = hInst;<br />
    wc.hIcon         = LoadIcon(hInst, TEXT("TestIcon"));<br />
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);<br />
    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);<br />
    wc.lpszMenuName  = TEXT("TESTMENU");<br />
    wc.lpszClassName = szMyClass;<br />
<br />
    if (!RegisterClass(&wc))<br />
        return FALSE;<br />
<br />
    // Create the window<br />
    HWND hwndMyWindow = CreateWindow(szMyClass, TEXT("Black Ice printer Driver Message Capture Sample"),<br />
                                WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, 0,<br />
                                CW_USEDEFAULT, 0, NULL, NULL,<br />
                                hInst, NULL );<br />
<br />
    if ( !hwndMyWindow )<br />
        return FALSE;<br />
<br />
	ShowWindow (hwndMyWindow, SW_SHOW);<br />
<br />
    // Get and dispatch messages until WM_QUIT message<br />
    while ( GetMessage(&msg, NULL, 0, 0 ) )<br />
    {<br />
        TranslateMessage(&msg); // translates virtual key codes<br />
        DispatchMessage(&msg);  // dispatches message to window<br />
    }<br />
    return (int) msg.wParam;    // return value of PostQuitMessage<br />
}<br />


Thank you very much
you can save my life.
GeneralRe: capturing message from app2 Pin
Anonymous5-May-04 3:49
Anonymous5-May-04 3:49 
GeneralThank You CodeProject Pin
gUrM33T4-May-04 4:44
gUrM33T4-May-04 4:44 
GeneralRe: Thank You CodeProject Pin
jmkhael4-May-04 4:51
jmkhael4-May-04 4:51 
GeneralAckermann Function Pin
pmasknguyen4-May-04 4:24
pmasknguyen4-May-04 4:24 
GeneralRe: Ackermann Function Pin
Jens Doose4-May-04 4:36
Jens Doose4-May-04 4:36 
GeneralFinding Mem Usage of another program Pin
tjkrz4-May-04 4:16
tjkrz4-May-04 4:16 
GeneralRe: Finding Mem Usage of another program Pin
Joe Woodbury4-May-04 4:23
professionalJoe Woodbury4-May-04 4:23 
GeneralRe: Finding Mem Usage of another program Pin
Dudi Avramov4-May-04 5:08
Dudi Avramov4-May-04 5:08 
GeneralShellExecute in VC++ Pin
PrashantJ4-May-04 4:07
PrashantJ4-May-04 4:07 
GeneralRe: ShellExecute in VC++ Pin
Jens Doose4-May-04 4:22
Jens Doose4-May-04 4:22 
GeneralRe: ShellExecute in VC++ Pin
PrashantJ4-May-04 21:00
PrashantJ4-May-04 21:00 
Generalabout inline. Pin
vividtang4-May-04 4:02
vividtang4-May-04 4:02 
GeneralRe: about inline. Pin
Joe Woodbury4-May-04 4:18
professionalJoe Woodbury4-May-04 4:18 
GeneralRe: about inline. Pin
vividtang4-May-04 15:17
vividtang4-May-04 15:17 
GeneralRe: about inline. Pin
Joe Woodbury4-May-04 19:32
professionalJoe Woodbury4-May-04 19:32 
GeneralRe: about inline. Pin
toxcct4-May-04 21:58
toxcct4-May-04 21:58 
GeneralProblem with std::map insert Pin
ykutanoor4-May-04 4:01
ykutanoor4-May-04 4:01 

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.