I have an app that is written Windows style, with a WinMain. It creates a nearly full-screen window, with a menu. It clears the client area to a chosen background color and writes a welcome message (TextOut) into it. It reads a file that contains a bitmap (a picture), and displays the picture. Then it creates a new device context (CreateCompatibleDC) and captures the entire client area into it, as a new, large bitmap, which it re-displays with Windows function BitBlt.
All of this takes about a second, and the window is up and running, ready for the user to start using the menu. The app contains a “window proc” to process messages from the window. The menu items are the window’s serious functions, such as a help file and the execution of external applications. Along with processing the menu items, the window proc also watches for messages telling that the window has been moved, re-sized, minimized, etc. For any one of these, it immediately invokes BitBlt to restore the contents of the client area. (Without BitBlt, there would be an annoying flicker as the picture was being re-painted.) It also watches for a left-click within the client area (%WM_LBUTTONDOWN). This is the user’s last resort in case the client area gets erased by another windoiw. It also invokes BitBlt and restores the client area instantly..
All of the essential features of the window work, but there are some cosmetic problems. One is that, if the window is dragged partly off the screen and back on again, the title bar and the menu bar are smeared. What’s happening is probably more technical than the way I am describing it, but it looks as though the pixels of these bars are moving at different rates as the window moves, so the title bar and menu bar are chopped into pieces and smeared out. (Note that the client area remains under control of the window proc, which repeatedly invokes BitBlt to preserve its original appearance.)
Has anyone had experience with this sort of behavior?
Another cosmetic problem is that I can’t get an icon to appear in the upper left corner of the title bar. The icon comes from an .ICO file, introduced by a script file. When the program is running, the icon appears in the Windows task bar at the bottom of the screen. However, there is an empty rectangle in the upper left corner of the window. The problem is not in my .ICO file, because my icon works in the SKELETON.BAS program of the PB Samples.
I am mentioning these problems together, because they may be related.
All of this takes about a second, and the window is up and running, ready for the user to start using the menu. The app contains a “window proc” to process messages from the window. The menu items are the window’s serious functions, such as a help file and the execution of external applications. Along with processing the menu items, the window proc also watches for messages telling that the window has been moved, re-sized, minimized, etc. For any one of these, it immediately invokes BitBlt to restore the contents of the client area. (Without BitBlt, there would be an annoying flicker as the picture was being re-painted.) It also watches for a left-click within the client area (%WM_LBUTTONDOWN). This is the user’s last resort in case the client area gets erased by another windoiw. It also invokes BitBlt and restores the client area instantly..
All of the essential features of the window work, but there are some cosmetic problems. One is that, if the window is dragged partly off the screen and back on again, the title bar and the menu bar are smeared. What’s happening is probably more technical than the way I am describing it, but it looks as though the pixels of these bars are moving at different rates as the window moves, so the title bar and menu bar are chopped into pieces and smeared out. (Note that the client area remains under control of the window proc, which repeatedly invokes BitBlt to preserve its original appearance.)
Has anyone had experience with this sort of behavior?
Another cosmetic problem is that I can’t get an icon to appear in the upper left corner of the title bar. The icon comes from an .ICO file, introduced by a script file. When the program is running, the icon appears in the Windows task bar at the bottom of the screen. However, there is an empty rectangle in the upper left corner of the window. The problem is not in my .ICO file, because my icon works in the SKELETON.BAS program of the PB Samples.
I am mentioning these problems together, because they may be related.
Comment