Windows NT ( 2)



         

DLLCALL - 3


// WndProc

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

LRESULT WINAPI

WndProc(HWND hWnd, UINT msg, WPARAM wParam,

LPARAM lParam)

{

switch(msg)

{

HANDLE_MSG(hWnd, WM_COMMAND, WndProc_OnCommand);

HANDLE_MSG(hWnd, WM_DESTROY, WndProc_OnDestroy);

default:

return(DefWindowProc(hWnd, msg, wParam, lParam));

}

}

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

// WndProc_OnDestroy

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

#pragma warning(disable: 4098)

void WndProc_OnDestroy(HWND hWnd)

{

PostQuitMessage(0);

return 0L;

}

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

// WndProc_OnCommand

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

#pragma warning(disable: 4098)

void WndProc_OnCommand(HWND hWnd, int id,

HWND hwndCtl, UINT codeNotify)

{

switch (id)

{

case ID_FILE_EXIT:

{

//

PostQuitMessage(0);

return 0L;

break;

}

case ID_FILE_FINDWINDOW:

{

//

// ,

//

if(DialogBox(hInst, MAKEINTRESOURCE(IDD_DLGFIND),

hWnd, DlgProc))

{

// DLL-:

//

/*

// ,

//

if(FindApplicationWindow(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-:

// DLL- LoadLibrary