In my project i never used new delete malloc calloc for any operation.
i used new operator only once to create object of xyz class in winmain() & free that object while exiting the project.
i had use vmr, vfw, gdi gdi plus ,icon instead of normal button in my application
after playing each new video memory is increases( in task manager)
even some times when i move mouse or click left button mem increases
how should i find is there any memory leak.
below code is used to textual display when cursor is move to any two icon(HOME & EXIT)
case WM_MOUSEMOVE:
{
HWND hwButton_home=GetDlgItem(g_hDialogWindow,IDC_ICON_HOME);
HWND hwButton_exit=GetDlgItem(g_hDialogWindow,IDC_ICON_EXIT);
WINDOWPLACEMENT lpwndpl_home;
WINDOWPLACEMENT lpwndpl_exit;
GetWindowPlacement(hwButton_home,&lpwndpl_home);
GetWindowPlacement(hwButton_analyze,&lpwndpl_exit);
if( ((lpwndpl_home.rcNormalPosition.left)<LOWORD(lParam)&& LOWORD(lParam)<(lpwndpl_home.rcNormalPosition.right)) && ((lpwndpl_home.rcNormalPosition.top)<HIWORD(lParam)&& HIWORD(lParam)<(lpwndpl_home.rcNormalPosition.bottom)))
{
if(IsWindowEnabled(hwButton_home))
{
::SetWindowPos(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), HWND_NOTOPMOST, lpwndpl_home.rcNormalPosition.left, lpwndpl_home.rcNormalPosition.bottom, 45,18, SWP_NOZORDER);
SetWindowText(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), "HOME");
ShowWindow(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), TRUE);
}
}
else if( ((lpwndpl_exit.rcNormalPosition.left)<LOWORD(lParam)&& LOWORD(lParam)<(lpwndpl_exit.rcNormalPosition.right)) && ((lpwndpl_exit.rcNormalPosition.top)<HIWORD(lParam)&& HIWORD(lParam)<(lpwndpl_exit.rcNormalPosition.bottom)))
{
if(IsWindowEnabled(hwButton_exit))
{
::SetWindowPos(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), HWND_NOTOPMOST, lpwndpl_exit.rcNormalPosition.left+5, lpwndpl_exit.rcNormalPosition.bottom, 75,18, SWP_NOZORDER);
SetWindowText(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), "EXIT");
ShowWindow(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), TRUE);
}
}
else
ShowWindow(GetDlgItem(g_hDialogWindow, IDC_MODE_TEXT), FALSE);
}
break;
when i placed mouse on this icon 4 bytes of meme increases.