473,406 Members | 2,220 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,406 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 1010

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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.