Windows NT ( 2)



         

DLLCALL - 4


// DLL-

hDLL = LoadLibrary("DLLDEMO.DLL");

// ,

//

if(hDLL != NULL)

{

//

GetAppWindow =

(MYDLLPROC)GetProcAddress(hDLL,

"FindApplicationWindow");

// ,

if(GetAppWindow != NULL)

{

// ,

//

if(GetAppWindow(szWindowTitle) != NULL)

MessageBox(NULL, "Application window was found",

szAppTitle, MB_OK | MB_ICONINFORMATION);

else

MessageBox(NULL,

"Application window was not found",

szAppTitle, MB_OK | MB_ICONINFORMATION);

}

// DLL-

FreeLibrary(hDLL);

}

}

break;

}

case ID_HELP_ABOUT:

{

MessageBox(hWnd,

"DLL Call Demo\n"

"(C) Alexandr Frolov, 1996\n"

"Email: frolov@glas.apc.org",

szAppTitle, MB_OK | MB_ICONINFORMATION);

return 0L;

break;

}

default:

break;

}

return FORWARD_WM_COMMAND(hWnd, id, hwndCtl, codeNotify,

DefWindowProc);

}

// -----------------------------------------------------

// DlgProc

// -----------------------------------------------------

LRESULT WINAPI

DlgProc(HWND hdlg, UINT msg, WPARAM wParam,

LPARAM lParam)

{

switch(msg)

{

HANDLE_MSG(hdlg, WM_INITDIALOG, DlgProc_OnInitDialog);

HANDLE_MSG(hdlg, WM_COMMAND, DlgProc_OnCommand);

default:

return FALSE;

}

}

// -----------------------------------------------------