 |
 |
In the case where a popup menu is too long to fit on the screen, I would like it to scroll in response to the Page Up, Page Down, Home, and End keys. Is there any way to accomplish this? It would also be nice if the menu scrolled in response to the mouse wheel. It seems that by default the only way to scroll a popup menu is via the arrow buttons at the top and bottom of the menu, or via the up and down keys. This is counter-intuitive, particularly on small screens.
I understand that long popup menus are suboptimal, and that the stock behavior may be Microsoft's subtle way of discouraging me from using such menus, but I want it to work better regardless. I would be willing to use a hook function if necessary, however even if I manage to intercept the relevant keys it's not obvious how I can tell the menu to scroll, since it isn't a window.
I have observed this behavior on Windows 7 using Common Controls 6, in both Aero and Classic themes. Is the behavior likely to differ in Windows 8, and/or in later versions of Common Controls?
|
|
|
|
 |
hi,
my code keep encounter the 10053 error when running in windows7 but works fine in winXP.
what might be wrong?
here is my code http://paste.ubuntu.com/7456583/
and here is the output: http://paste.ubuntu.com/7456610/
the error is always happens in the loop:
for (j=0;j<10000;j++) {
sprintf(buf,"%d,%d,%d\n",0,0,0);
sendall(sock,buf,strlen(buf),__LINE__);
readall(sock,buf,4,__LINE__);
n = *(int *)buf;
assert(n==4);
readall(sock,buf,64,__LINE__);
std::cout<<"j= "<<j<<std::endl;
Sleep(1000);
}
BTW, the server side will not close socket.
UPDATE:I used wireshark to notice that the 10053 was caused by the TCP RST packet that was pushed to remote server by my client. The time that the RST packet was sent is always right after a packet received that contains 64 bytes I shall read at the end of the loop.
But my code is never intended to do that. I'm stuck with this problem for days.
Thanks.
modified 14-May-14 11:26am.
|
|
|
|
 |
Please do not expect people to download your code and diagnose your problem for you. Show the lines of code where the error occurs (not the entire program) and provide the complete error message associated with the error code.
|
|
|
|
|
 |
This error may occur if the connection is blocked by a firewall or anti virus program. Because the error occurs with Windows 7 and not with XP, the probable source is the Windows 7 firewall. Configure your firewall(s) to allow traffic from/to the used protocol and port.
|
|
|
|
 |
Jochen Arndt wrote: This error may occur if the connection is blocked by a firewall or anti virus program. Because the error occurs with Windows 7 and not with XP, the probable source is the Windows 7 firewall. Configure your firewall(s) to allow traffic from/to the used protocol and port.
thanks for your reply. I have disable my windows firewall and all my anti-virus program. The problem remains. And I noticed that my machine sends TCP RST packet right after receive 64bytes from remote server. The RST packet which causes the 10053 error is never intended in my code.
|
|
|
|
 |
The RST can be send by any device/software which is involved in the transmission including routers between client and server. Did you capture the RST at client or server side?
You may install client and server on the same machine if possible and connect using the loopback interface. Such connections are usually not filtered by any software like firewalls. If the problem is then still there, it may be Windows 7 TCP stack specific.
A useful link that goes into detail about RST packets: http://blogs.technet.com/b/networking/archive/2009/08/12/where-do-resets-come-from-no-the-stork-does-not-bring-them.aspx[^].
|
|
|
|
 |
Jochen Arndt wrote: The RST can be send by any device/software which is involved in the transmission including routers between client and server. Did you capture the RST at client or server side?
You may install client and server on the same machine if possible and connect using the loopback interface. Such connections are usually not filtered by any software like firewalls. If the problem is then still there, it may be Windows 7 TCP stack specific.
A useful link that goes into detail about RST packets: http://blogs.technet.com/b/networking/archive/2009/08/12/where-do-resets-come-from-no-the-stork-does-not-bring-them.aspx
Thanks for your replay. I just found out that it is server side's fault. A java coder write the server side code which sends out one byte urgent message via java API function sendUrgentData() at the end of the loop, in order to detect whether the connect is open( this is a really bad method to do the detection).
I asked he comment out this statement, than my code work fine!!
It turns out it is the win7 network stack that sends out RST packet in response to seeing frequent urgent packet. I guess it is a new self-protection reaction introduced in win7. The same phenomenon is never observed in xp or linux.
|
|
|
|
 |
Fine to here that you resolved the issue and posted the reason. It may be helpful for others.
|
|
|
|
 |
Hi,
I'm working in pretty unfamiliar terrain, so I apologise if this is the wrong place to ask this question or if the question is wrong.
I'm trying to write code that acts on events in Microsoft software. I've worked out how to do this for generic Windows hooks like for keyboard entries, but can't work out how to do it for Office events (e.g., saving or printing a document).
Can anyone point me to a reference of hooks available in Office?
Thanks
|
|
|
|
 |
Member 10710970 wrote: I've worked out how to do this for generic Windows hooks like for keyboard entries A keyboard/mouse hook does not work based on events - it works by hooking a API call.
Member 10710970 wrote: but can't work out how to do it for Office events (e.g., saving or printing a document). Correct.
Member 10710970 wrote: Can anyone point me to a reference of hooks available in Office? API Hooking with MS Detours[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
 |
Is there any way to listen to a certain file, let's say a password protected archive, and catch the password that is used by another program to open/decrypt that archive ?
Thanks in advance!
|
|
|
|
 |
No.
First, Windows didn't support password protected archives.
Second, questions on how to break security like that will get you banned. We don't condone hacking.
modified 19-May-14 8:20am.
|
|
|
|
 |
In My application, I have used the following code to get the region of a dialog.
HRGN hRgn = CreateRectRgn( 0, 0, 0, 0 );
int nRet = GetWindowRgn( hRgn );
if(ERROR == nRet)
{
DWORD dw= GetLastError();
}
The problem is that, sometimes "GetWindowRgn" returns error "invalid handle" even if CreateRectRgn returns a non-null handle which is used for GetWindowRgn.
I have set the region in onSize(). So dialog have region.Also after GetWindowRgn returns error, when i call GetWindowRgn() again, second call is working fine !!!
Issue is reproduced only sometimes in a Windows 7 machine.
Anyone already faced similar issue?
Thanks,
Arun
|
|
|
|
 |
You already posted this in the C++ forum; please do not crosspost, it wastes everyone's time.
|
|
|
|
 |
Please could you recommend a good book about programming for Windows 8.1 in Visual C++ which:-
* Lists all the Windows API functions and what they do and how to call them, including the difference between 1-byte and 2-byte characters.
* Says what a device-context etc is, and likewise all the technicalities of programming for Windows API.
|
|
|
|
 |
There is no book that lists all of the Windows API functions. It would be way too thick. The only place that haas that information is MSDN.
As for "how to call all of them", you learn how to pass the various kinds of parameters then apply that knowledge to any API call you want. You will not find a "how to call this function" for every function in the API library.
But, for a book, there's these[^]. You will probably not find all the information you want in a single book.
|
|
|
|
 |
actually a full and complete refrence for api is MSDN
but to learn api functions what we should know at last ??
when i go to msdn i completly confusing
|
|
|
|
 |
There is no real answer to that question. What you need to know depends entirely on the app you're writing. You then do a bunch of research to teach yourself what you need to know.
I guess, the only answer that I can come up with is you need to have some kind of overview of how Windows works, perhaps reading Windows Internals 6th Edition[^] would help. It's a two book set now.
|
|
|
|
 |
You may see here also - Useful Reference Books[^]
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
 |
Yes, many years ago, a book named "microsoft win32 manual" is published.
It is a very useful book, lists all the windows api about win32.
you can find it.
nice to make friends with you !
|
|
|
|
 |
Please what is the Visual C++ statement to make all the current window, or a specified area of the current window, scroll n pixels up or down?
This is in handling the condition "case SB_THUMBTRACK:" that arises in handling a vertical scrollbar.
modified 24-Feb-14 4:10am.
|
|
|
|
|
 |
If the screen window displays text, if the vertical bar's thumb is moved down a bit, so that the text on the window must be displayed n pixels higher, then it is quickest to scroll the window's existing contents up by n pixels, then I must rewrite only the bottom n rows of pixels. So please how, in a given screen area, to move every pixel upwards by n pixels?
|
|
|
|
 |