 |
|
 |
Hello,
It still is very ammusing how some people try and program but yet most dont even understand the concept of how Microsoft does stuff and how windows works.
This source will never make it to any real application because the programmer is NOT using alot of the Windows API in the correct way. Oh dont believe it well for one compile the project in debug mode and you will instantly see one major flaw and that is Access Violation User 32 DLL, Really dude you mean you dont check this out but just build it in release mode and yes it does run in release mode cause its not checking to see that your using the API correctly as debug mode does.
Next comment is on the CopyImage function, Duh dude oviously you did not look up the commands flags and settings cause calling it a horrible function is just retarded. Using this function makes a new copy evertime you call it thats not a GDI Leak cause your suppose to either delete the object when your done with it or you can set the flags so that when it makes a copy of a resource it deletes the original for you but oh well I guess you dont know that.
If you were determined to use this function setting this flag would only maintain one copy however
it is still recomended you as the programmer delete the object when done with it.
LR_COPYDELETEORG 0x00000008 Deletes the original image after creating the copy.
Now as far as the flashing when drag it arround fast dont get that problem here you must have some sort of sh***y video card, monitor or computer, however a major flaw is your not handling all the windows messages for instance let the screen save start and then come back having this window in view well you never handle the message and repaint it after the screen saver resulting in it looking all messed up so dude goback to school and learn some more.
In the MyRegisterClass function or any function using a structure if you do not set all the members you must assure the members have valid settings like 0 so to fix the crash on debug mode simply set all the members of any structure you can try the method mentioned
wcex = {0};
thats kinda cheesy way and doesnt assure all members get set the recomended way is
memset(&wcex, 0, sizeof(WNDCLASSEX));
Liquid Snake
modified 6 Dec '11.
|
|
|
|
 |
|
 |
I`m trying to make an application wich have a very narrow GUI.
But When trying to size in the borders the title seems to get overlapped by the bitmap filling the title bar. I`m sure the solution is simple but I think the code is very complex and hard to understand so could you help me with a solution?
|
|
|
|
 |
|
 |
hi, this problem was existed when use default system font. the solution is use a right font and draw it into titlebar.
and change the code in function CSkinWindow::OnNcPaint, code like below:
//draw text
if(!WindowText) WindowText = (char*)malloc(sizeof(char)*255);
int len = GetWindowText(m_hWnd, WindowText, 255);
RECT textRect;
textRect.left = 30;
textRect.top = 0;
textRect.right = width - bmpTop.bmWidth + 80 /* - 40*/;
modified on Monday, May 26, 2008 8:48 PM
|
|
|
|
 |
|
|
 |
|
 |
i use Visual studio 2003 and 2005 to compile it.
|
|
|
|
 |
|
 |
Dear Author,
Thanks for this great job, I just have one question on how to get the built-in scrollbar with the window ??
|
|
|
|
 |
|
 |
I dont working this class with CreateDialog!!! Why???
|
|
|
|
 |
|
 |
Hmm, i'm only test it in a normal window, not in dialog. sorry! i'll test it in future.
|
|
|
|
 |
|
 |
Keep up the good work, Win32 is cool!
|
|
|
|
 |
|
 |
I noticed the lag when resizing, and then I run a profiler to find some clue, the function of CreateRegionFromBitmap used too much cpu time
|
|
|
|
 |
|
 |
U may use UpdateLayeredWindow if the application is only run at NT
|
|
|
|
 |
|
 |
Interesting article! Your code is clean, impressive even, and I enjoyed examining it, but
I had to change “WNDCLASSEX wces;” to “WNDCLASSEX wces = {0};” in order to keep it from crashing, after compiling. Since it is C++ code, instead of C, I would have used “sizeof(HANDLED_MESSAGE)/sizeof(UINT)” instead of MESSAGE_COUNT (one less value to keep track of), but to each their own.
I could not recreate the problem you mentioned, but you could try invalidating the previous rectangle and calling ‘UpdateWindow’ after, for immediate results. I experimented with a couple of versions of that idea, but since the problem is not occurring on my machine, I saw no change in behavior. I believe it usually happens when the CPU is running at 100% and is handling a higher priority thread, so it may not work.
I wish I had more time to spend studying your work, but that is life.
Keep up the good work.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
 |
|
 |
maybe this is a problem what low configuration of my computer with integrated display card, 8MB display memory.
my computer's confinguration:
IBM X60 series
CPU: Intel duo 2 processes
Memory: 1GB
display card: integrated, 8MB display memory
|
|
|
|
 |
|
 |
If you create your window with WS_SYSMENU style, there will be many strange behaviors.
Look ahead, all is dark.
|
|
|
|
 |
|
 |
Indeed, you must deal with many other things too, such as menu bar, WS_EX_CONTEXTHELP, WM_SETICON, WM_STYLECHANGING/WM_STYLECHANGED, WM_SETCURSOR, WM_SYSKEY*, etc.
Look ahead, all is dark.
|
|
|
|
 |
|
 |
Even with MFC, I always had trouble getting the menus correctly painted, could you check this using your framework ?
Kochise
In Code we trust !
|
|
|
|
 |
|
 |
I like to see articles like this. It attempts to address a question that many programmers new to programming directly with the Win32 API would wonder about.
Just a few observations:
* At first glance the skinned window looks just like an unskinned window. That’s likely to confuse anyone that runs the code looking for the difference that skinning can make (well it confused me until I looked deeper).
* You have a minor bug in MyRegisterClass. Not all members of the WNDCKASSEX structure are assigned. The fix is trivial, simply replace
WNDCLASSEX wcex; withWNDCLASSEX wcex = {0};
* While handling messages plays an important part, there is more to skinning than just handling messages.
In regard the Problem/Bugs you mentioned...
I didn’t actually observe the problem you described, although resizing did look a little tardy. An increase in CPU utilisation is normal during a resize, but the code you have here does quite a bit during resizing, which will tend to exaggerate this effect. If you observe the monitor “flashing” during resizing (I didn’t), your code might be doing an InvalidateRect on NULL, which would force a redraw of the desktop.
You have chosen a very ambitious project here. Good luck with it.
|
|
|
|
 |
|
 |
David, you are skilled and very good yo~
|
|
|
|
 |