Solved

How to get rid of the #32770 Dialog class name ?

Posted on 2000-02-21
5
1,352 Views
Last Modified: 2013-11-20
Codebits :

in CWinApp::Initinstance :

WNDCLASS wndcls;      
      ZeroMemory(&wndcls, sizeof(WNDCLASS));
      wndcls.style                  =  CS_HREDRAW | CS_VREDRAW;
      wndcls.lpfnWndProc          = AfxWndProc;
      wndcls.hInstance          = AfxGetInstanceHandle();
      wndcls.hIcon                  = ::LoadIcon(wndcls.hInstance, MAKEINTRESOURCE(IDR_MAINFRAME));
      wndcls.hCursor                  = ::LoadCursor(wndcls.hInstance, IDC_ARROW);
      wndcls.hbrBackground      = (HBRUSH)(COLOR_WINDOW + 1);
      wndcls.lpszMenuName            = NULL;
      wndcls.lpszClassName      = "G2Diktatie";
      
      // Register name, exit if it fails
      if (!AfxRegisterClass(&wndcls))
      {
             AfxMessageBox( _T("Failed to register window class!"),
                   MB_ICONSTOP | MB_OK );
             return FALSE;
      }

in CDialog::PrecreateWindow :

cs.lpszClass = "G2Diktatie";


This doesn't seem to work though, not for CDialog anyways.
Anyone got a better idea ?
(I think this is "hard")

NooGie
0
Comment
Question by:noogie6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:jhattingh
ID: 2543113
Have you tried SetWindowLong() using the GWL_EXSTYLE ?


The SetWindowLong function changes an attribute of the specified window. The function also sets a 32-bit (long) value at the specified offset into the extra window memory of a window.

LONG SetWindowLong(
  HWND hWnd,       // handle to window
  int nIndex,      // offset of value to set
  LONG dwNewLong   // new value
);


0
 
LVL 11

Accepted Solution

by:
mikeblas earned 200 total points
ID: 2543356
All dialogs in Windows have the class "#32770". That's because they're dialogs.

Remember--among the things that Windows associates with the window class is the window procedure. Windows provides the default Window procedure for _all_ dialogs, and that procedure turns around and calls your dialog proc.

That's not the way regular, user-classed windows work. But dialogs need to work that way so Windows can supply all the functionality the Dialog Manager brings.

It's a complete mystery to me why you'd want to remove the class name from your dialogs, by the way. Are you just trying to make it easy for some other application to find your dialog?

If you really need to do this, your only alternative is to create a popup window and set its styles to make it look like a dialog. But that makes your window procedure responsible for doing all the dialog things--translating arrow keys and tab order, managing the template, handling focus, and so on. It's quite a bunch of work to do it right.

..B ekiM

0
 
LVL 11

Expert Comment

by:mikeblas
ID: 2543358

 jhattingh> Have you tried SetWindowLong() using the GWL_EXSTYLE ?

Why would he try that?  That changes the extended style _bits_ on the window--like WS_EX_TOPMOST or WS_EX_STATICEDGE. Your suggestion does nothing for the window class name, and the window class name is what noogie6 is asking about.

..B ekiM
0
 
LVL 1

Expert Comment

by:jhattingh
ID: 2543378
Relax Mike - EE is a place where people help out. I was helping out. Doesn't mean I'm always right.
0
 
LVL 12

Expert Comment

by:migel
ID: 2549652
Hmm
you must have strong reason to change dialog class.
In general you must set CLASS member in the dialog template and have already registered Window class before this dialog being created.
Also this Window class must reference to the window procedure that will call DefDlgProc by default instead DefWindowProc and have additionall Wnd bytes that is
wndclass.cbWndExtra = DLGWINDOWEXTRA.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 98
Host to IP 7 83
Looking for a specific application/software 2 119
zeroMAx challenge 20 127
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question