|
It is setup with the "resizing" border style in the dialog properties window. It also resizes fine, and the WM_SIZE message comes through as expected, but the WM_SIZING message just never seems to happen.
I dug around a bit more in the dialog and it's base classes, and found that the sizing isn't done entirely through the framework like I though it was. The sizing actually happens inside of a mouse move event which calls "SetWindowPos" when the left mouse is also down. I don't know exactly why this was done (it was done ages ago, long before I started working on it and the developer who did it is no longer here).
Is this the likely culprit? Will a call to SetWindowPos to resize a frame cause the WM_SIZE and WM_WINDOWPOSCHANGING messages to come through as I'm seeing, but not WM_SIZING? That doesn't make much sense ... if WM_SIZE fires, WM_SIZING should as well.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
All I can think is that calling the SetWindowPos is more of a 'final' event than 'resizing' a window is, so there is no 'sizing' message only the 'here is the new size' message. If the mouse movement was cpatured for a different reason and the window's position was adjusted by Windows, instead of by the handler of the dialog itself, you would probably get all the messages you are expecting.
|
|
|
|
|
Yeah, as soon as I saw that, I was afraid that was the case. I'll have to see what I can do about removing this current way of sizing. From what I can tell of the code so far, the only reason it was done this way is so that the code can put a limit on how large the dialog gets ... which is perfectly handled in OnSizing (once I can get that event to happen anyway).
Thanks.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
You should also see if you can receive the WM_MINMAXINFO message, which is where you are supposed to constrain the minimum and maximum size your window can get.
|
|
|
|
|
What do you do in your top level window to be notified that the screensaver has become active? I want to respond to this and temporarily disable a periodic event.
Likewise, what notification is received once the screensaver has been deactivated and your window is now 'visible' again, even though your window might not be the one that is the 'active' window?
|
|
|
|
|
How about SetWindowsHookEx(WH_FOREGROUNDIDLE, ...) or SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, ...) ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
1. I could not see that the WH_FOREGROUNDIDLE would directly apply to the screensaver. I suppose if this event is detected, I could create a different timer to check the SystemParametersInfo every 30 seconds or so to see if the screensaver had become active.
2. This requires polling and is not a notification. I am looking for something sent to all 'top level windows' when the screensaver becomes active.
I did find this one, WlxScreenSaverNotify , but I don't want to replace the GINA DLL.
|
|
|
|
|
Blake Miller wrote:
1. I could not see that the WH_FOREGROUNDIDLE would directly apply to the screensaver.
My bad.
Blake Miller wrote:
2. This requires polling and is not a notification. I am looking for something sent to all 'top level windows' when the screensaver becomes active.
When a screen saver starts, it posts a WM_SYSCOMMAND message to the foreground window with wParam equal to SC_SCREENSAVE .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I saw this article in the MSDN, hope it helps.
HOWTO: Know When Your Screen Saver Starts
ID: Q238882
|
|
|
|
|
If you set a system wide hook for mouse and keyboard when you detect the screen saver has started you'll be able tell when the screen saver has stopped as it is mouse and keyboard activity that they respond to.
Remember that for a system wide keyboard/mouse hook the hook functions need to be in a dll.
|
|
|
|
|
Thanks. I already hook the low level mouse handler, I can just add a low level keyboard hook to that same DLL.
|
|
|
|
|
Now all I have to do is hope that EVERY possible application that has the foreground focus will post the SAME message to all other top level windows, and then we can all be notified when the screen saver starts. It still does not seem like a sure thing for every window...
|
|
|
|
|
Hi.
I'm tearing my hair out here.
I am trying to debug a .exe on a remote PC. I have done everything mentioned in article "Remote Debugging in MSVC++ 6.0" and in the MSDN help, but get the following when I try to debug...
"Unable to start debugging, access is denied. Verify that you are an administrator or debugger user". I am logged on the remote PC as an administrator, but with a different logon name to the one on my local PC (where I'm also an administrator). Surely this shouldn't matter?????
Also, when it says "verify that YOU are an administrator..." what does it mean by "YOU" who's it looking for????
Any help much appreciated!
Thanks!!
JC.
|
|
|
|
|
Sounds like the user is the problem. I think you need to add the user you are logging on to the development machine as to the administrator or debugger group on the target machine
|
|
|
|
|
you can use the following command in the command prompt window:
net use \\remotePC /user:remotePC\user_with_admin_rigths *
That should be done before any connection to that remotePC.
The subsequent connections will use user_with_admin_rigths credentials.
WBR
Henry
|
|
|
|
|
Thanks guys!
I've got it working now. I just needed to type -tcpip and -anyuser after the msvcmon.exe in the command prompt on the remote PC. It seems to default to using pipes.
|
|
|
|
|
Hello boys,
I´m novice programming in visual C++ and I don´t know how can I convert an hexadecimal string to a byte array. Can you help me please?
Thank you very much
|
|
|
|
|
char c = 0;
char str[] = "7D";
sscanf(str, "%X", &c);
printf("c = %d = 0x%X", c, c);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thank you very much for your reply,
I don´t kown if what you sent could be useful for my purpose, anyway I´m novice and I could be probably wrong. As long as I can see in your code I can´t create a BYTE array, only a char array. Is this correct?
My actual problem is that I have an hexadecimal Hash string (40 elements) and I need to convert this Hash to its equivalent BYTE array. 1 Byte = 2 hexadecimal characters, so I need 20 Bytes in my BYTE array.
The problem is that this Hash can´t change during the conversion!!!
I´m using some Cryptography functions (CryptCreateHash, CryptSetHashParam, CryptSignHash, etc...). I have to set the hexadecimal Hash string as the Hash to sign with the CryptSetHashParam function, but first of all I need to convert this Hash to a BYTE* element.
Thank you very much for your patient
|
|
|
|
|
One way to do it is to use strtoul() on every two characters (while specifying 16 as the base) - looping through to the end of your source of hex chars (need to check for % 2 of course). As each value is returned, you can add them to a CByteArray or a fixed sized array of bytes.
Let me know if this doesn't make sense.
|
|
|
|
|
Hello,
I have proved your solution with this code:
char *demodemoHex = "5863d9e4cbdf522eaa62e0747fceb1c5b249ba13";<br />
char **stopString;<br />
BYTE *hexArray = new BYTE[20];<br />
int j = 0;<br />
char hexChar[2];<br />
<br />
for (int i=0; i < 20; i++)<br />
{<br />
hexChar[0] = demodemoHex[j];<br />
hexChar[1] = demodemoHex[j+1];<br />
hexArray[i] = strtoul(hexChar, stopString, 16);<br />
j = j + 2;<br />
<br />
}<br />
<br />
cout << "@@@@ hexArray value visualization" << endl;<br />
for (int i = 0; i < 20; i++)<br />
{<br />
printf("%2.2x ",hexArray[i]);<br />
}
And the output is:
@@@@ hexArray value visualization
58 63 d9 e4 cb df 52 2e aa 62 e0 74 7f ce b1 c5 b2 49 ba 13
It seems to be OK!!! I´m going to prove the output hexArray with some Cryptographyc functions. I will tell you what happen.
Thank you very much!!!
|
|
|
|
|
I have proved your solution with some cryptography functions (exactly CryptSetHashParam ) and it works correctly.
Thank you very much to all the people that helped me, specially lynchspawn
|
|
|
|
|
eurosetas wrote:
I can´t create a BYTE array, only a char array...
A BYTE is nothing more than an unsigned char .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Uppss!
Thank you for the explanation!
|
|
|
|
|
what i am seeking is some guidelines.
Picture this:
I have a team developing the same application , and we use VSS.
We do not release major Versions, we distribute our application by releasing small builds, and every time i send one build to the testing people, i will wait for their feed back while my team starts new features (for the next build).
Now, if i place a "label" in VSS marking the "beta build" and my team starts woking again, the label will not do me any good because its does not reflect the build that will be sent to the customers. On the other hand if wait until i have the build ready to send to the customers, i can not place a label on VSS because the code will have changes made by my team after i send the build to testing people.
For this to work this way i would have to give "vacations" to my team whil in testing fase.
Not very good ...
How do i solve this?
How do you test a build and work on the next without multiple copies of the source code?
|
|
|
|