Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC DLL's

MFC DLL's

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelptutorialworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    charu123
    wrote on last edited by
    #1

    Hi, I want to create a DLL which puts and icon in the taskbar on click of tht icon an exe is run. I wrote the following code. The Compiler is not recognising the VERIFY Macro and AfxGetInstanceHandle method. This code might be wrong becoz i ma jus trying . Could someone help me out with this. #include #include #include "example.h" #define MYWM_NOTIFYICON (WM_USER+2) BOOL WINAPI DllMain (HINSTANCE hinstDLL, // handle to the DLL module DWORD fdwReason, // reason for calling function LPVOID lpvReserved) // reserved { return TRUE; } EXPORT void WINAPI Systray () { // CString sTip(_T("System Configuration")); DWORD dwMessage=NIM_ADD; NOTIFYICONDATA tnd; HWND m_hWnd; tnd.cbSize = sizeof(NOTIFYICONDATA); tnd.hWnd = m_hWnd; tnd.uID = IDR_TRAYICON; tnd.uFlags = NIF_MESSAGE|NIF_ICON; tnd.uCallbackMessage = MYWM_NOTIFYICON; VERIFY( tnd.hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE (IDR_TRAYICON)) ); tnd.uFlags = NIF_MESSAGE|NIF_ICON|NIF_TIP; //lstrcpyn(tnd.szTip, (LPCTSTR)sTip, sizeof(tnd.szTip)/sizeof(tnd.szTip[0]) ); Shell_NotifyIcon(dwMessage, &tnd); if(dwMessage == MYWM_NOTIFYICON) { if((LPARAM)tnd.uCallbackMessage==WM_LBUTTONDBLCLK) { if((WPARAM)tnd.uCallbackMessage==IDR_TRAYICON) { ShellExecute(NULL, "open", "http://www.brigsoft.com/", NULL, "", SW_SHOW); } } } } Thanks U get wht u Give

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups