|
I don't need to reverse any actions. Okay here's an analogy...
You have a black chalkboard. It's got nothing on it. A bunch of people go up to the chalkboard and write all over it. At some point, someone pulls down a screen in front of part of the chalkboard. The problem is... when the screen is put back up, the part of the chalkboard that was covered is now erased.
How do I code to resolve that issue.
|
|
|
|
|
dhomas wrote: when the screen is put back up
This is what I meant by reverse an action.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Hello
I am working on a Win32 Application in Visual Studio 2003 environment.
I want the whole app to wait until USER click an OK button on the screen.
This app has multiple threads running simultaneously. So is it possible to stop the whole app until an OK button is pressed?
|
|
|
|
|
you could suspend[^] all your threads (EXCEPT the UI thread, of course!) when you start the wait and resume[^] them if OK is pressed?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
why we can't overload .,->, :: operators?
|
|
|
|
|
The -> operator can be overloaded. The others cannot. See here for why.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thnx very good link....i got many things cleared
|
|
|
|
|
Hello,
I'm having problems with minimizing all windows within an MDI at the same time. I can loop through all open windows and minimize them one at a time (but that causes lots of delay with more than 5 windows, as they all go one after the other).
I can minimize the whole application with:
::SendMessage(pMainFrame->m_hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
or I can minimize individual active frames with:
::SendMessage(pMainFrame->GetActiveFrame()->m_hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
But how do I minimize them all at once?
Thanks for your help,
Dave
|
|
|
|
|
That's not a standard message but an application-specific thing. As far as I know, closing them one at a time is your only option.
Just for grins, what would happen if you posted the message instead:
::PostMessage(pMainFrame->GetActiveFrame()->m_hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); or
pMainFrame->GetActiveFrame()->PostMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Both just minimize the active frame (window), and not all frames.
I thought there would be something more standard(MFC) I could just send to the mainFrame which handles it all, similar to the way MFC handles tiling or cascading windows.
|
|
|
|
|
blueflame213 wrote: Both just minimize the active frame (window), and not all frames.
Didn't you put it in a loop?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Sorry, I may not have been clear enough,
When minimizing a window, it shows the animation of the window title bar being minimized to the bottom.
When looping through all windows to minimize, the delay of having to watch each window individually be minimized becomes significant with many windows open.
I was wondering if there was something which would minimize all windows at once, without having to sit through each window displaying its "minimization animation".
I appreciate your help so far!
|
|
|
|
|
blueflame213 wrote: Sorry, I may not have been clear enough,
No, you were perfectly clear. It's just that you said in the initial post, "I can loop through all open windows and minimize them one at a time" but in your last post you said, "Both just minimize the active frame (window), and not all frames." I assumed you removed the loop in the latter post, hence my confusion.
My suggestion to post the message instead of sending it was not meant to solve the problem but rather to minimize the perception of a delay.
If you had an example of an application that minimizes all open frames at once, you might could spy on it and see what messages, if any, are being used.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Found a solution with using
ShowWindow(SW_HIDE) first and then ShowWindow(SW_MINIMIZE),
This way XP doesn't show it's "minimizing animation" while minimizing, and it speeds everything up significantly!
Thanks for all of your help!!
|
|
|
|
|
Good find.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am writing a c++ code for converting bmp file into jpeg....
The algorithm i have followed is:
1)Convert RGB color space to Y,Cb,Cr..
2)Down sample Cb and Cr by 2..that means for each square block of 2*2 there is 4 different Y
value but 1 Cb and 1 Cr value..
3)Apply DCT to data units of each 8*8 pixels...
4)Then apply quantization on DCT coefficient by using standard quantization table of Cb and Cr.
5)Do zigzag ordering.
6)Encode the DC and AC coefficient separately using huffman encoding.
7)Write proper header and write huffman encoded value to the file...
By doing all this things correctly(cross checked for various imaged and values) I am still not getting
the jpeg image correctly displayed.
Then i made a small 8*8 24 bit(color depth) bmp file completly filled with color value R=10 B=10
and G=100...all 64 pixels are of same color..
The data that i m getting at every step is as follows...
Bmp Image Header:
size of header 40
width 8
height 8
no of planes 1
no of bits per pixel 24
image size 194
x resolution pixel per meter 2834
y resolution pixel per meter 2834
no of colors 0
no of imp colors 0
The Y Cb Cr conversion of (R,B,G)=(10,10,100) is (62,-29,-37)
so lets consider Y component first..
The DCT coefficient for Y component is :
495 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
After Quantization, the zig zag ordering of single data unit that i m getting is this, for Y component.
30 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0
Now the huffman coding of above zig zag order array is :
Y dc coding: 00111110
Y ac coding: 1010 (for ac huffman table(luminance Y) EOB value is 1010)
Similary huffman coding of Cb and Cr components is as follows:
cb dc coding: 11000010
cb ac coding: 01 (for ac huffman table(chrominance Cb,Cr) EOB value is 01)
cr dc coding: 110101110
cr ac coding: 01
Final Huffman code that i get is:
001111101010110000100111010111001 Length 33
so to make it divisible by 8 padding of 1 is done.
0011111010101100001001110101110011111111 Length 40.
Here each single 0 or 1 is actually a bit that needs to be stored as it is in the jpeg file but since we
cant write bit by bit into file, a total of 8 bit is taken and converted into a integer value in base 10
and stored that into a character which now takes 1 byte.
So this is all procedure and some specific data that i have shown here...but still i m not getting my
image shown correctly..
can somebody help me out on this!!!!!!!!!
|
|
|
|
|
|
You don't need code.
Use Win32 Shell api (1 line of code)
|
|
|
|
|
I have a listview within an MDI child window. There is another child window with tree control also in the MDI application.
Steps to replicate the problem:
First I open the child window with tree control, leave it as it is in non-maximized state.
Then I open the second child window which has the list view.
Maximize the child window which has listview.
Close the listview from maximized state.
Application crashes.
I have cornered it to a MoveWindow() call, but could not go any further, is this a known problem with listview, is there any specfic tweaking that needs to be done? It causes the crash irrespective of data filled in the listview!
Environment:
OS- XP SP3
Pure Win32 application
No MFC is used
This is my call to create the listview:
CreateWindowEx(<br />
WS_EX_CLIENTEDGE,<br />
WC_LISTVIEW,<br />
"",
WS_CHILD | WS_VISIBLE | LVS_REPORT,<br />
0, <br />
0, <br />
rect.right,
rect.bottom,
m_hwndParent,<br />
NULL,<br />
(HINSTANCE) GetWindowLong (m_hwndParent, GWL_HINSTANCE),<br />
NULL);
|
|
|
|
|
Where is the MoveWindow called?
On which window is MoveWindow called?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi Superman,
Thanks very much for your reply.
Sorry for missing out that detail. MoveWindow() is called on WM_SIZE of child window in winproc of the child window which has the list view in it.
case WM_SIZE:
RECT rect;
GetClientRect(hWnd, &rect);
MoveWindow(m_hwndListView,
0,
0,
rect.right,
rect.bottom,
true);
break;
|
|
|
|
|
I'm guessing the crash occurs because MoveWindow is called on the list view after it is destroyed.
Try putting an IsWindow check over the MoveWindow.
if (IsWindow(m_hwndListView))
{
MoveWindow(m_hwndListView,
0,
0,
rect.right,
rect.bottom,
true);
}
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks very much for your reply.
IsWindow() did not help.
Crash occurs only under following condition:
Child window containing tree control is opened and kept in non-maximized state
Then, child window containing the list is maximized and then this closed.
Anything else that you could think of?
|
|
|
|
|
You could try to use MoveWindow only when the wParam parameter of WM_SIZE is SIZE_RESTORED.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|