473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Win 32 AppendMenu SteamFriends problem

93 64KB
Hey peeps, I have a problem with Win32 and Steam friends...

Now I want to get the steam friends from the STEAM_API.dll and make a AppendMenu underneath "hFriendsButton" no matter how many it is. But to make a button underneath this you need to have a AppendMenu function for each friend, but if you have like a 20-30 person clan, I have to put in that many AppendMenus. So is there a way to this as efficient as possible?

The name displayed on the button should be the name of the friend(use number from 1 to 5 or something).

The Source Code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. HMENU hMainMenu = CreateMenu();
  3. HMENU hFile = CreateMenu();
  4. HMENU hView = CreateMenu();
  5. HMENU hGameButton = CreateMenu();
  6. HMENU hFriendsbutton = CreateMenu();
  7. HMENU hMapButton = CreateMenu();
  8. HMENU hSettings = CreateMenu();
  9. HMENU hHelp = CreateMenu();
  10.  
  11. AppendMenuA(hMainMenu, MF_POPUP, (UINT_PTR)hFile, "File");
  12. AppendMenuA(hMainMenu, MF_POPUP, (UINT_PTR)hView, "View");
  13. AppendMenuA(hMainMenu, MF_POPUP, (UINT_PTR)hGameButton, "Game");
  14. AppendMenuA(hMainMenu, MF_POPUP, (UINT_PTR)hMapButton, "Map");
  15. AppendMenuA(hMainMenu, MF_POPUP, UINT_PTR)hFriendsbutton, "Friends");
  16. AppendMenuA(hMainMenu, MF_POPUP, (UINT_PTR)hSettings, "Settings");
  17. AppendMenuA(hMainMenu, MF_POPUP, (UINT_PTR)hHelp, "Help");
  18.  
  19. AppendMenu(hFile, MF_STRING, (UINT_PTR)hFile, "Exit");
  20. AppendMenu(hView, MF_STRING, (UINT_PTR)hView, "Will Come SOON!");
  21. AppendMenu(hGameButton, MF_STRING, (UINT_PTR)hGameButton, "Dayz Mod");
  22. AppendMenu(hGameButton, MF_STRING, (UINT_PTR)hGameButton, "Dayz Standalone");
  23. AppendMenu(hMapButton, MF_STRING, (UINT_PTR)hMapButton, "Chernarus");
  24. AppendMenu(hMapButton, MF_STRING, (UINT_PTR)hMapButton, "Chernarus+");
  25. AppendMenu(hFriendsbutton, MF_STRING, (UINT_PTR)hMapButton, "friend: " + friends);
  26. AppendMenu(hSettings, MF_STRING, (UINT_PTR)hSettings, "Will Come SOON!");
  27. AppendMenu(hHelp, MF_STRING, (UINT_PTR)hHelp, "Will Come SOON!");
  28.  
  29. SetMenu(hwnd, hMainMenu);
Feb 26 '15 #1
0 1009

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
117
by: Peter Olcott | last post by:
www.halting-problem.com
17
by: Jon Slaughter | last post by:
I'm having a little trouble understanding what the slicing problem is. In B.S.'s C++ PL3rdEd he says "Becayse the Employee copy functions do not know anything about Managers, only the Employee...
0
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing...
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
2
by: Spacetech | last post by:
Im trying to make it so I can read something out of a file and get it into a string so I can see if It matches what IM looking for. Here is what I got: HANDLE hFile; DWORD wmWritten; char...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.