Newbie: Menu and icons not showing ? 
Author Message
 Newbie: Menu and icons not showing ?


I created a new a menu and a new icon in my project using the Visual C++
wizard. Gave both of them the same ID as the project. This is the basic code
segment that  I use to load the two:

#include <windows.h>
#include "resource.h"


TCHAR szAppName[] = TEXT("DEMO");

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
     HWND         hwnd ;
     MSG          msg ;
     WNDCLASS     wndclass ;         = CS_HREDRAW | CS_VREDRAW ;
     wndclass.lpfnWndProc   = WndProc ;
     wndclass.cbClsExtra    = 0 ;
     wndclass.cbWndExtra    = 0 ;
     wndclass.hInstance     = hInstance ;
     wndclass.hIcon         = LoadIcon (NULL, szAppName) ;
     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
     wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
     wndclass.lpszMenuName  = szAppName;
     wndclass.lpszClassName = szAppName ;

However, the icon and menu just don't get loaded. (No error messages). I
tried changing the IDs, made sure I have the correct case, but it dies not

Please help,


PS: (I am trying to learn WinAPI using Charles Petzoid's book).

Sat, 21 Dec 2002 03:00:00 GMT  
 Newbie: Menu and icons not showing ?
I am also reading Charles Petzoid`s book at this time .

I think you should not use
NULL but the Instance of the
file where the icon is saved

Fri, 10 Jan 2003 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. newbie: menu and icons not loaded ?

2. UserControl does not show on running form and properies do not show

3. how do you NOT show the taskbar icon for an app

4. Edited icon's not shown.

5. Icon for data files not showing in FileSave/FileOpen dialog

6. List View Control - Icon Does Not Show

7. App icon not showing correctly

8. Document Menu not showing up in NT 4

9. TrackPopupMenu does not show menu labels

10. Menu not showing up in 98...but it does in Win2k

11. CMultiDocTemplate not showing correct menu?

12. OCX created in VB does not show Menu in CDialog


Powered by phpBB® Forum Software