|
You're welcome .
Software Zen: delete this;
|
|
|
|
|
This now works but I have a different but related problem.
In my example above, how can I detect a left and a right mouse click on the menu item "entry1" and process them differently?
Lock
Recent Entries -> Clear Entries
entry1
Minimize
Restore
Exit
I can use flags "TPM_LEFTBUTTON | TPM_RIGHTBUTTON" in the call to TrackPopupMenu so that both left and right mouse clicks are accepted and I have used Spy++ to prove that the Windows message for WM_LBUTTONUP and WM_RBUTTONUP are generated - but I need to get the information on which button has been pressed on the menu item to the routine in my dialog application that is notified of a click on that menu item via the:
"ON_COMMAND( id, memberFxn )" and "afx_msg void memberFxn( );" statements.
Again all help gratefully received.
|
|
|
|
|
|
Is there any way to select a file in the listview in Explorer? ShellExecute seems to only work with folders...
- thanks
|
|
|
|
|
Yes, but you'll need a few calls to FindWindowEx() to find the correct SysListView32 control. Once you have a handle to the control's window, you can just send it a LVM_SETITEMSTATE message.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
how do i protect an activex not to replace?
|
|
|
|
|
how do i protect an activex not to replace?
|
|
|
|
|
Hello All,
I have 2 question
1-How to convert cm to pixel
2-How to convert inch to cm
Thank you
|
|
|
|
|
1 inch == 2,54 cm
number of pixels per inch depends on DPI (dots per inch)
96 DPI = 37,795275590551 pixel per cm
|
|
|
|
|
Hello Visible_Info,
To get value of picxel per inch use this function
GetDeviceCaps(hdc, LOGPIXELSX);
Number of pixels per logical inch along the screen width. In a system with multiple display monitors, this value is the same for all monitors.
GetDeviceCaps(hdc, LOGPIXELSY);
Number of pixels per logical inch along the screen height. In a system with multiple display monitors, this value is the same for all monitors.
For getting more help click here[^]
|
|
|
|
|
Hello. I was just wondering if anyone knew a simple way to find the colour of a specific pixel displayed on the screen by ANY program.
I used this program called "Macro Scheduler" which had a very simple GPC (Get Pixel Colour) command to use which returned the colour in a number of a specific pixel displayed on screen regardless of which program displayed it. Is their something similar in C++?
I'm very new to C++ but if I could get around this problem I could start on my project and learn along the way.
I also don't really care about the specific colour, like if 256 colours or whatever, I just need to find a value to distinguish between pixels displayed on MY screen.
Any help is greatly appeciated.
-- modified at 0:54 Sunday 19th February, 2006
|
|
|
|
|
Hello OnTilt
I specify one of the way but i am not sure that this is a proper or not.
First make on dailog form which has two property you have o set.
1) Full screen mode
2) Transperent display mode
Now by calling any function which can return pixel value of form will return pixel value of screen. And one more thing this dailog form will not affect operation of any other application.
If this is not usefull to then i am sorry.
Regards,
Divyang Mithaiwala
|
|
|
|
|
Take a look at the GetWindowDC[^] API, if you pass NULL as it's window handle it will return a device context back for the current desktop. After that you can use GetPixel[^] to retrieve the color for any pixel. You'll need something like:
COLORREF GetDesktopPixel( int x, int y )
{
COLORREF cl = 0;
HDC hDC = NULL;
hDC = GetWindowDC( NULL );
cl = GetPixel( hDC, x, y );
DeleteDC( hDC );
return cl;
}
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Hey thanx Gavin.
It's realy nice. I don't know about this. Thanx again.
Reagards,
Divyang Mithaiwala
|
|
|
|
|
Take a look at the GetWindowDC[^] API, if you pass NULL as it's window handle it will return a device context back for the current desktop. After that you can use GetPixel[^] to retrieve the color for any pixel. You'll need something like:
COLORREF GetDesktopPixel( int x, int y )
{
COLORREF cl = 0;
HDC hDC = NULL;
hDC = GetWindowDC( NULL );
cl = GetPixel( hDC, x, y );
DeleteDC( hDC );
return cl;
}
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Exactly what I was looking for Gavin. Thanks guys.
|
|
|
|
|
|
How to trap the interrupts produced in Windows Environment,by establishing a system wide monitor/hook.
What is the core API to be used?
(_dos_getvect & _dos_setvect cannot be used in MS VC++ programs)
Any one having any intresting Idea??
-Rane
Rane
|
|
|
|
|
Under Windows NT, 2000, XP, and Server 2003, applications can not handle interrupts. Interrupt handling is reserved for device drivers. Typically, a device driver will handle an interrupt and then signal an event. An application will have a worker thread waiting on that event. It isn't real-time, but it is safer than allowing applications direct access to hardware.
Software Zen: delete this;
|
|
|
|
|
Is it possible to write a universal driver to trap the software interrupts alone.
(Any class/API supporting it?)
Rane
|
|
|
|
|
Hey Guys ..
I'm running a Win32 Console UDP Server/Client application. I want to run my server update function inside my main loop while also checking for key input. All I need to check for is if a single key has been pressed.
The kicker is I need a way to continue on with the update without pausing for user input. When the user hits 't' for toggle it calls a function that closes the socket and reopens it as a server or client.
Here's what I have now, but as I said I need something that doesn't wait for user input.
Update()
{
char toggle;
toggle = cin.get()
if(toggle == 't')
{
ToggleMode();
}
// get all the packets we can
while(ReceiveData());
// Send all the data to the clients
SendData();
return true;
}
Thanks in advance!
|
|
|
|
|
Have a look at _kbhit()
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Do I have to be using the CRT libraries for this?
I tried including <conio.h> but when I do:
if(_kbhit())
{ToggleMode()}
It never gets into the true condition hen I press any key on the key board.
Any help?
|
|
|
|
|
jc0dex wrote: Do I have to be using the CRT libraries for this?
Yes. _kbhit is a C run-time function. Look it up in MSDN for some sample code.
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
I found that GetAsyncKeyState does exactly what I was needing.
Thanks guys!
|
|
|
|