Is it possible to flatten multiple memory bitmaps into one device context? I just spent the whole day writing a class for layer management, where you can create as many layers as you like, then address them by name and draw to them, and when your all ready, call one function and it bitblt's all the layers into the dc of your window. The only problem is after I wrote all the code, I realized that the memory bitmaps have a black background, and when you bitblt one bitmap onto another, it just replaces what was there before. is it possible, or did I just waste my whole afternoon?
bmw5002
Posts
-
Layering Bitblt -
Convert LPSTR to LPCSTRHow can I convert a pointer to a string to a pointer to a constant string?
-
Startup computer automaticallyNo its not possible. That is set in the bios, and you have no programmatical access to the bios.
-
port scan detectorI never said nMap detected portscanning. I meant that trying to detect nMap portscans would be hard.
-
Gradient MasksI'm writing my own text ticker/scroller type thing that only needs the handle to a static control on a dialog or wherever, and the rest is completely self contained in the class, the timers dont need windows to process their events. Anyway I want to have the left and right edges of the scroller fade. So say the background was dark blue, and the text was white. The white text would fade to blue at the edges. Now from my photoshop experience, at first I thought, black-to-white gradient as a mask. But how would I accomplish that with the GDI? At first I thought alpha-blending, but I didnt see a way to use a grayscale gradient as the guide for transparency. So then I saw the MaskBlt function. So I'm thinking create a monochrome memory bitmap with gradients on either side, then use that as the mask and a color memory bitmap with the text as the source, and the destination would be the solid background color layer. Then I would BitBlt that to the static control. So my question is, would this theoretically work? Am I going in the right direction?
-
Waitable TimersI'm getting undeclared identifier errors at compile time for CreateWaitableTimer and SetWaitableTimer. I have Winbase.h included and Kernel32.lib is of course already inherited. What am I doing wrong???
-
port scan detectorWe wont develop your program for you. I suppose you could monitor the ports for connections, but then when you put nMap portscanner into the picture it might get a little harder. nMap doesnt actually try to connect to the port to see if its open. I think it uses arp requests or something, its been awhile since i used/read about it. So that will require some more programming.
-
Non-Static CallbacksRight now I decided to use the multimedia timers to call my drawing routine, and the callback doesnt support and void user-defined params. So I figured out all I really need to do is name a pointer of type of my class static and put it in the class declaration like so: static CScroller * ClassPtr; So now my static wrapper callback can access it and use it to call the non-static member function that does all the drawing work. What a nice little hack. I love it. Anyway as I was reading that article i mentioned earlier from the code project, I noticed how just having "static CScroller * ClassPtr;" in my class declaration would cause an undefined external object linking error. The article mentioned putting "CScroller * CScroller::ClassPtr;" in my class implementaion. That fixed the error. What I want to know is how does doing that fix it and why does it get that linking error if I don't put it?
-
Change Exe contents while runningPolymorphic exes are just viruses that rewrite their machine code every time they propogate. That has nothing to do with modifying a file that is in use.
-
Change Exe contents while runningI don't think its possible to do that while its running. The solution I can think of might take a little work. Basically u write another app and insert the binary data for that app into a resource in your main app. Then you have a function that extracts the resource data using api calls and saves that file in a temporary folder, wherever. It then looks at the end of that file, and inserts the data that you want to change in your main app. Then it executes that program and closes itself. The extracted program then waits a second or two for the main program to end and then looks at itself and writes that data to the closed main program. Then it executes the main program again and closes itself. You can look it up, but I don't recall that you can write resources to the app you are executing the call from at runtime. And you definitely can't obtain write privilages to yourself while your running. Don't take my word for it though.
-
Non-Static CallbacksI read this about using a wrapper for Non-Static Callbacks within a class. (http://www.codeproject.com/cpp/SetTimer\_\_non-static.asp) Its brilliant. I can't believe I never thought of it. Anyway, would it be possible to use a Non-Static callback with threads? I want to run another thread within my class using CreateThread, but I want the thread to be able to access the members of my class. Is it possible?