![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Sup guys,
A part of my menu is supposed to capture all open windows and list them, the problem is; since the number of windows could be random I have no way of knowing what's open so I need to know what the user clicked on, I prepared this piece of code to do that - C++ Syntax (Toggle Plain Text)
Sadly enough though my program does not retrieve the title... Do you guys know what went wrong or of any easier way? Thanks. Last edited by Ancient Dragon; Jan 26th, 2008 at 5:52 PM. Reason: corrected code tags -- do not put any spaces in them |
|
|
|
|
|
#2 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 499
Rep Power: 4
![]() |
Re: A menu issue -
You need to check the return value of MenuItemFromPoint() to see if it is a valid position. It returns -1 on error. And is that code inside the menu event handler ?
|
|
|
|
|
|
#3 | |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Quote:
C++ Syntax (Toggle Plain Text)
I have done it like this because if there is any menu item that has no identifier(in my code its only the list of windows) it would get passed to th default and I should be able to take things by doing that. When a user is to click on the unidentified menu item, I would retrieve the string from the clicked menu item then search for the window using FindWindow then do whatever I wish with the selected window. But at this point I can't figure out what went wrong ![]() Thanks, a lot! ![]() Last edited by Ancient Dragon; Jan 26th, 2008 at 9:44 PM. Reason: corrected code tags |
|
|
|
|
|
|
#4 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 499
Rep Power: 4
![]() |
Re: A menu issue -
Thanks for attempting to use code tags, but next time don't put any spaces in them. You had the right characters, you just can't have any spaces between the brackets.
You probably should learn to use your compiler's debugger. I know Dev-C++ has one, but I don't know how to use it either. Search Dev-C++'s forums and you will probably find that information. Here is a good place to start. |
|
|
|
|
|
#5 |
|
Expert Programmer
|
Re: A menu issue -
gdb is quite easy to use. All I know how to do is type "up" at the prompt but that is often enough to find the problem with my code. I code on Mac OS X, but I believe there is a Windows port available.
|
|
|
|
|
|
#6 |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Re: A menu issue -
Well, first of all I use Borland C++ Builder 6
secondly I don't know how to use a debugger And finally I am not sure it can help, because the code has runtime ISSUES and not problems(a debugger detects problems not issues(there is a slight difference)), by issues I am refering to the way something is coded...Any ideas? Thanks. |
|
|
|
|
|
#7 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 499
Rep Power: 4
![]() |
Re: A menu issue -
>>secondly I don't know how to use a debugger
Learn. Its your program and your problem, now ours. If you are going to write programs them you must learn how to debug them. debuggers will also help sort out issues as you like to call them. |
|
|
|
|
|
#8 |
|
Programmer
Join Date: Dec 2007
Posts: 93
Rep Power: 1
![]() |
Re: A menu issue -
Well I guess I'll look for information in the time... Maybe its worth mensioning that the menu is not used using SetMenu() because my program is a tray icon and instead I use TrackMenuPopup()...
Any ideas? Thanks. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java Popup Menu | titaniumdecoy | Java | 7 | Mar 12th, 2006 11:17 AM |
| dropdown menu with persistence? | kerriganm | HTML / XHTML / CSS | 11 | Dec 17th, 2005 2:33 PM |
| Creating a menu within a loop? | bivhitscar | C | 8 | Nov 9th, 2005 6:35 AM |
| Need help with a realtime branching menu | Zeteg | JavaScript and Client-Side Browser Scripting | 11 | Aug 27th, 2005 11:36 AM |
| HELP!!! Perl script to display drop down menu on webpage | domquem | Perl | 8 | Jun 2nd, 2005 9:48 AM |