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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What's the class name registered by MFC?

What's the class name registered by MFC?

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionhelp
2 Posts 2 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.
  • W Offline
    W Offline
    Wenrich
    wrote on last edited by
    #1

    In my application, i want to use FindWindow(className, windowTitle) to determine whether an instance of this application has already been running. But what is the class name registered by MFC? let's say, the project name is "Myapp", and classes CMyappApp, CMyappDoc, CMyappView, CMainFrame are created by VC++. i tried them but none worked. Please help me! Thanks a lot!!!!

    T 1 Reply Last reply
    0
    • W Wenrich

      In my application, i want to use FindWindow(className, windowTitle) to determine whether an instance of this application has already been running. But what is the class name registered by MFC? let's say, the project name is "Myapp", and classes CMyappApp, CMyappDoc, CMyappView, CMainFrame are created by VC++. i tried them but none worked. Please help me! Thanks a lot!!!!

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      MFC creates class names on the fly using 'Afx' prefix and hex values for background brush/cursor/window style. FindWindow isn't the way to go for determining if app is already running, at least not with class/caption only. You should consider using named mutex for that; there should be some articles right here on CP. Tomasz Sowinski -- http://www.shooltz.com

      *** Purgamentum init, exit purgamentum ***

      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