Click here to Skip to main content
16,006,440 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Circular linked list puzzle Pin
melwyn9-Dec-03 5:16
melwyn9-Dec-03 5:16 
GeneralRe: Circular linked list puzzle Pin
Ravi Bhavnani8-Dec-03 7:11
professionalRavi Bhavnani8-Dec-03 7:11 
GeneralRe: Circular linked list puzzle Pin
Jörgen Sigvardsson8-Dec-03 8:08
Jörgen Sigvardsson8-Dec-03 8:08 
GeneralRe: Circular linked list puzzle Pin
melwyn9-Dec-03 5:21
melwyn9-Dec-03 5:21 
GeneralRe: Circular linked list puzzle Pin
melwyn9-Dec-03 5:18
melwyn9-Dec-03 5:18 
QuestionFindWindow with class name - how do I set the class name? Pin
srev8-Dec-03 3:23
srev8-Dec-03 3:23 
AnswerRe: FindWindow with class name - how do I set the class name? Pin
srev8-Dec-03 5:08
srev8-Dec-03 5:08 
AnswerRe: FindWindow with class name - how do I set the class name? Pin
Mike Dimmick8-Dec-03 5:13
Mike Dimmick8-Dec-03 5:13 
That's one of MFC's self-generated window classes. It tries to cut down on the number of unique classes by generating a class name derived from some of the options in WNDCLASS. The sequence is Afx: followed by
  • Instance handle (base address of executable/DLL)
  • Style bits (here CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS)
  • Cursor handle
  • Background brush handle (COLOR_WINDOW + 1)
  • Icon handle
You'll need to call AfxRegisterClass to register your own class and use that instead.
BOOL CMyWnd::PreCreateWindow(CREATESTRUCT& cs)
{
   WNDCLASS wc = { 0 };
  
   wc.style = CS_HREDRAW | CS_VREDRAW;
   wc.lpfnWndProc = DefWindowProc;
   wc.hInstance = AfxGetInstanceHandle();
   wc.hIcon = ::LoadIcon( IDR_MAINFRAME );
   wc.hCursor = AfxGetApp()->LoadStandardCursor( IDC_ARROW );
   wc.hbrBackground = (HBRUSH) ( COLOR_WINDOW + 1 );
   wc.lpszMenuName = NULL;
   wc.lpszClassName = _T( "Your Class Name Here" );
 
   if ( !AfxRegisterClass( &wc ) )
      return FALSE;
 
   cs.lpszClass = wc.lpszClassName;
 
   return TRUE;
}
should do the trick.
GeneralRe: FindWindow with class name - how do I set the class name? Pin
srev8-Dec-03 5:34
srev8-Dec-03 5:34 
GeneralRe: FindWindow with class name - how do I set the class name? Pin
Mike Dimmick8-Dec-03 5:45
Mike Dimmick8-Dec-03 5:45 
GeneralRe: FindWindow with class name - how do I set the class name? Pin
srev8-Dec-03 5:56
srev8-Dec-03 5:56 
Questionhow to replace icon resource from ico file. Pin
Xiaodi_Liu8-Dec-03 3:02
Xiaodi_Liu8-Dec-03 3:02 
AnswerRe: how to replace icon resource from ico file. Pin
David Crow8-Dec-03 8:07
David Crow8-Dec-03 8:07 
GeneralWindow HWND Pin
Ares28-Dec-03 1:22
Ares28-Dec-03 1:22 
GeneralRe: Window HWND Pin
Fredrik Skog8-Dec-03 1:56
Fredrik Skog8-Dec-03 1:56 
QuestionHow to set/change file permissions on NTFS folder on Win2000 Pin
Valera2411768-Dec-03 0:42
Valera2411768-Dec-03 0:42 
QuestionWho knows where to find the source code for ripping CD and encoding track to MP3, OGG, WMA etc? Pin
zhaopzhi8-Dec-03 0:23
zhaopzhi8-Dec-03 0:23 
AnswerRe: Who knows where to find the source code for ripping CD and encoding track to MP3, OGG, WMA etc? Pin
BaldwinMartin8-Dec-03 3:12
BaldwinMartin8-Dec-03 3:12 
AnswerRe: Who knows where to find the source code for ripping CD and encoding track to MP3, OGG, WMA etc? Pin
ZoogieZork8-Dec-03 9:10
ZoogieZork8-Dec-03 9:10 
GeneralCompiling under Xp for NT Pin
Onkie8-Dec-03 0:20
Onkie8-Dec-03 0:20 
GeneralRe: Compiling under Xp for NT Pin
Mike Dimmick8-Dec-03 6:14
Mike Dimmick8-Dec-03 6:14 
GeneralCString to CComBSTR to use for IDirectorySearch Pin
bjolletts7-Dec-03 23:30
bjolletts7-Dec-03 23:30 
GeneralRe: CString to CComBSTR to use for IDirectorySearch Pin
Mike Beckerleg8-Dec-03 2:42
Mike Beckerleg8-Dec-03 2:42 
GeneralRe: CString to CComBSTR to use for IDirectorySearch Pin
Jonathan Craig8-Dec-03 2:45
Jonathan Craig8-Dec-03 2:45 
GeneralRe: CString to CComBSTR to use for IDirectorySearch Pin
bjolletts8-Dec-03 3:21
bjolletts8-Dec-03 3:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.