Popup menu

[b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL

Here is the initialisation code:
[code]
switch (iMsg) {
case WM_CREATE :
SetInternational();
hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
// if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
hMenu = GetSubMenu(hMenu, 0);
if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
return 0 switch (iMsg) {
case WM_CREATE :
SetInternational();
hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
// if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
hMenu = GetSubMenu(hMenu, 0);
if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
return 0;
[/code]

My problem is the second if It returns NULL instead of the menu handler... Anyone


Comments

  • I could not find any problem here. [b]If[/b] the menu is loaded, GetSubMenu [b]must[/b] succeed. Or tell me if I've missed something...
    _____________________________
    [size=1][b][grey]Cold[/grey][blue]Shine[/blue][/b]
    http://www20.brinkster.com/coldshine[/size]

  • : I could not find any problem here. [b]If[/b] the menu is loaded, GetSubMenu [b]must[/b] succeed. Or tell me if I've missed something...
    : _____________________________
    : [size=1][b][grey]Cold[/grey][blue]Shine[/blue][/b]
    : http://www20.brinkster.com/coldshine[/size]
    :
    :
    I tried to if the load menu but it didn't return NULL so it must have returned window handler if I if the getsubmenu it just won't work... if I comment the getsubmenu out it doesn't work neither....
  • : [b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
    : Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL
    :
    : Here is the initialisation code:
    : [code]
    : switch (iMsg) {
    : case WM_CREATE :
    : SetInternational();
    : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : hMenu = GetSubMenu(hMenu, 0);
    : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : return 0 switch (iMsg) {
    : case WM_CREATE :
    : SetInternational();
    : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : hMenu = GetSubMenu(hMenu, 0);
    : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : return 0;
    : [/code]
    :
    : My problem is the second if It returns NULL instead of the menu handler... Anyone
    :
    :
    :
    hiya are u trying to create a normal popup menu??
    if u are i can send the code for that..
    grahamoj.
  • : : [b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
    : : Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL
    : :
    : : Here is the initialisation code:
    : : [code]
    : : switch (iMsg) {
    : : case WM_CREATE :
    : : SetInternational();
    : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : hMenu = GetSubMenu(hMenu, 0);
    : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : return 0 switch (iMsg) {
    : : case WM_CREATE :
    : : SetInternational();
    : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : hMenu = GetSubMenu(hMenu, 0);
    : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : return 0;
    : : [/code]
    : :
    : : My problem is the second if It returns NULL instead of the menu handler... Anyone
    : :
    : :
    : :
    : hiya are u trying to create a normal popup menu??
    : if u are i can send the code for that..
    : grahamoj.
    :

    If you could do that... It would be great:

    BadGuy@BadGuy.nl if you could send it there
  • : : : [b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
    : : : Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL
    : : :
    : : : Here is the initialisation code:
    : : : [code]
    : : : switch (iMsg) {
    : : : case WM_CREATE :
    : : : SetInternational();
    : : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : hMenu = GetSubMenu(hMenu, 0);
    : : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : return 0 switch (iMsg) {
    : : : case WM_CREATE :
    : : : SetInternational();
    : : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : hMenu = GetSubMenu(hMenu, 0);
    : : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : return 0;
    : : : [/code]
    : : :
    : : : My problem is the second if It returns NULL instead of the menu handler... Anyone
    : : :
    : : :
    : : :
    : : hiya are u trying to create a normal popup menu??
    : : if u are i can send the code for that..
    : : grahamoj.
    : :
    :
    : If you could do that... It would be great:
    :
    : BadGuy@BadGuy.nl if you could send it there
    :
    hi will send it to you tomorrow for def. have to get it off other machine.
    grahamoj.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories