|
I want to get menu string but those lines could not give me a menu string.
Thank you.
|
|
|
|
|
This works fine for me:
char szBuffer[64];
HMENU hMenu = GetSystemMenu(hWnd, FALSE);
GetMenuString(hMenu, 0, szBuffer, sizeof(szBuffer), MF_BYPOSITION);
GetMenuString(hMenu, 1, szBuffer, sizeof(szBuffer), MF_BYPOSITION);
GetMenuString(hMenu, 2, szBuffer, sizeof(szBuffer), MF_BYPOSITION);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Dear all,
How to detect what kind of browser is running and its version? For example, Netscape or IE; IE 5.0 or IE 6.0, ect.
Best regards,
|
|
|
|
|
Your question cannot be answered in its current form (as more than one browser can be installed at any given time). If you want to know the default browser, simply use FindExecutable() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
So, can we detect IE version?
BRs,
|
|
|
|
|
|
Yes, just use GetFileVersionInfo() and VerQueryValue() .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Hiya
I know this may be a VERY stupid question... but I have tried to find a way to toggle on the line numbering in MS Visual C++ 6.0... no success... anyone?
Thanks!
|
|
|
|
|
No such option exists. The only way to know what line the cursor is on is by the Line/Col indicator down in the lower right corner next to the keyboard status indicators.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
well... that sucks...
thanks anyway!
|
|
|
|
|
Hi everybody,
I have created an PopUp Menu in a CDialog...it works OK.
Now I want to create a PopUp Menu inside an ActiveX every time I click Button RIGHT of the mouse...
I have copied the code inside the function WM_RBUTTONDOWN...The problem is that it shows the Menu but it is DISABLED (it is shown but I can not select an option).
How can I do it to solve it...to make it enable?
Thanks
Here the code :
HMENU hMenu = ::CreatePopupMenu();
if (NULL != hMenu)
{
// add a few test items
::AppendMenu(hMenu, MF_ENABLED | MF_STRING & !MF_GRAYED, 1, "Change Color");
::AppendMenu(hMenu, MF_ENABLED | MF_STRING & !MF_GRAYED, 2, "Hide");
::AppendMenu(hMenu, MF_ENABLED | MF_STRING & !MF_GRAYED, 3, "Item 3-");
ClientToScreen(&point);
int sel = ::TrackPopupMenuEx(hMenu,
TPM_CENTERALIGN | TPM_RETURNCMD,
point.x,
point.y,
m_hWnd,
NULL);
CString s;
s.Format("The selected item is %d", sel);
TRACE(s);
:estroyMenu(hMenu);
|
|
|
|
|
javi_jmc wrote:
& !MF_GRAYED
These parts are not necessary, and will actually screw it up and make it not work.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
How do I implement 'delay' in VC++?
I also need to find out a way to get the "time elapsed" between two commands like when the data on the serial port goes high.
Can some one also give me info on the following -
GettickCount
Dword
VERIFY
ASSERT
dwcount
Thanks in advance.
-hithesh
|
|
|
|
|
Sleep is the command to make your app stop for a bit.
hithesh wrote:
Can some one also give me info on the following -
msdn.microsoft.com can.
hithesh wrote:
GettickCount
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. ( first hit on google )
hithesh wrote:
Dword
A DWORD is an unsigned long. It's a really big number.
hithesh wrote:
ASSERT
An ASSERT is a construct that will fail if the condition you pass it fails. This means that in debugging, you can check the assumptions that your code makes about the state of your application at any point. It is not included in release builds, and should be used for debugging only.
hithesh wrote:
dwcount
Is probably a variable called count, that is of type DWORD, and has been created using Hungarian notation ( where the first few letters of a camel case variable name denote the type of the variable )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian, Thanks for the answers.
For the delay, I knew about sleep. I need something thats similar to a timer.
like -
1. when a bit goes high
2. start timer
3. stop timer when the bit goes low.
Sleep is used when you know the amount of delay you want, right? If this is not right, plz gimme an example.
|
|
|
|
|
Anonymous wrote:
Sleep is used when you know the amount of delay you want, right?
Yes.
I don't know of any way to do this without implimenting it yourself, unless there's a variation on WaitForSingleObject that waits for a memory location to change. I'd imagine the thing to do is use sleep to sleep for small amounts of time, and then check your bit inbetween.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
chris,
How about settimer()?
I can't use sleep because, I am trying to find out the time duration during which the input is high and also the time duration during which the input is low. This is from the serial port which receives the Infra red signal from the TV remote. Then, I send the same signal out. Its kinda like learning.
|
|
|
|
|
Oh, OK. I've done stuff like that before. Yes, I used SetTimer inside my class that watches the serial port, and you can use a get time function to get the time before and after, to work out an interval. My code was in C#, and I was using the serial port as an input device.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can you give me an example. I looked at msdn, no good.
Thanks.
-hithesh
|
|
|
|
|
|
Hi everyone,
I have a main window with a gradient background onto which client area I output text using DrawTextEx. The background of the rectangle of the drawtext function is set to transparent. I invalidate this rectangle everytime I change the text so that the new text will be visible on the gradient background. This works fine for a while and then suddenly windows seems to stop painting the window all together ....? The text still continiues to be outputed , but on a white rectangle background now. The window does not seem to repaint either. I am using straight WIN32 api and simple message handling.
Anybody have any ideas ? This is driving up the walls... help will be much appreciated.
Carpe Deum
|
|
|
|
|
Perhaps you're not freeing resources (pens, brushes) you use in your painting code? That could lead to resource exhaustion. Try adding VERIFY s to your code to verify correct operation and see if they fail.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I write the code which is given below that is getting ram and hard disk capacity from user than saving it in a file and than displaying the file. after that i jst want to display all the records entered by the user and also display the total number of computers whose records were entered by the user. plz hlp me what should i do. code is below:
//Header Files
#include <iostream.h>//header file for input output streams
#include <fstream.h>// Header for file I/O
#include <conio.h>//header file for console input output
using namespace std;
//computerspec structurre
struct computerspec {
int ram;
int hdisk;
}compuspec;
int main()
{//start main
char ch;
ofstream out("computerspec.txt");//creating file name
out<<"RAM"<<"\t"<<"Hard disk"<<endl;
do=""
="" {="" start="" of="" while="" loop
="" prompt="" the="" user="" to="" enter="" ram="" capacity
="" cout<<"enter="" capacity"<<endl;
="" cin="">>compuspec.ram;
//for new line
cout<<endl;
prompt="" the="" user="" to="" enter="" hard="" disk="" capacity
="" cout<<"enter="" capacity"<<endl;
="" cin="">>compuspec.hdisk;
//for new line
cout<
|
|
|
|
|