VFP to create a struggle for screen chromips

xiaoxiao2021-03-06  78

After yourself, this screen chromor is finally successful (wait for a while, the younger brother will put this gadget to his website, everyone is interested in downloading to try), but this suffering process is probably only my own To understanding. Here the procedure is made as a development note as a former car. The front has been a smooth, declared function, then calls, although it is the first time, but the idea is more clear. Toned the help documentation of the API, I used the popular Jiangnan Red Rain API file, not bad, quite full, used to use these statements before, basically photo painting. It should be no problem with the syntax sleeve with VFP, but it is not thinking, so I have buried myself a deep disaster. I will have a bad happening in myself because of these statements. His statement is this: DECLARE integer GetCursorPos IN user32 as "GetCursorPos" string @lpPoint DECLARE integer ClientToScreen IN user32 as "ClientToScreen" integer hWnd, string @lpPointDECLARE integer GetPixel IN gdi32 as "GetPixel" integer hDc, integer xPos, integer yPosDECLARE integer Getdc in User32 AS "getdc" Integer HWND self-denial is no problem, but the inner line believes that it has been seen, but after having to realize this problem, he has experienced N more suffering. Don't say this first, let's talk. The first problem encountered, the conversion of coordinates. That is, two coordinates are displayed in the text box, which is an important part of which is also an important part of the color. Obviously, the VFP does not support the structure, and the string is changed. The type has been changed, and the calling API is also very successful. The specific code is in the previous article, there is no longer detailed, now the problem, how to put characters The type of string is converted into an integer type. From the VB's declaration, this string should be 64 bits, that is, 8 bytes, which are two 32-bit variables, ie x, y two long types (VB Declaration), so that these two are separated, further, horizontal, and longitudinal coordinates are 1024 or 1600 (of course, it is possible to be more, but it is believed that there will be no more than 65536 ^ _ ^), So it should be enough to take a decline. It is still a mistake, and now I have to convert two bytes simultaneously. The popular practice of online seems to use the charTobin () function conversion, but this is not a function of the VFP comes, you need to find the corresponding file from the Internet. It's not very good, I didn't find it. When I arrived in the mountain, I suddenly thought of ASC () although I can only handle the single character, but I can handle the processing twice, as a 2-bit 256 credit number, so this problem is solved.

If the method is made, it is also solved in the color, but a small episode appears in the middle, because the API returns a 4-word Integer type, obviously valid is three bytes, red, green, blue, but specifically The byte division is not very clear, so he is used to doing it from high to low, but after making it, it will find, red, blue, and the blue is reversed. Ha, adjusted, Everything OK. So, a decimal turn hexadecimal representation, then you can display two types, and then make a hotkey, copy the color value to the clipboard, everything OK. It can be released, compiled, and it is also very smooth, and there is no problem. I don't feel a problem, so I have a problem, so I have the installation package, come over the running library of VFP9, and there is no control needs to register, so I started compiling, wait until the other machine, I'm going to play a mistake: "Microsfot ViRal FoxPro Can Not loading resouce "It's really surprised. There should be it. The API function is the system self-generation. It should not be able to do it again, but get another machine, the problem is still. So I have to put two files for USER32.DLL and GDI32.DLL, and then build it again. This problem is solved, but you are really coming. Start pop-up form, but although it is an exception during the error, however, how can it be, it is very clear, but it is trying to be the same result, so open the project, re-debug. The unexpected appearance. It's also wrong, the same mistake! ! I am dizzy, I don't know what it is, I really want me to come from the beginning? What makes me more sad is that I have started an error before running. I wanted to be normally, it should be normal, the package is packaged, the statement also declares that she has to put it from the new API function declaration. However, the error of the error is getpixel () is not the first. I have to pass the doctor, when I got online, I saw an example of a VFP call example. It is a full hard disk volume sequence number, I put it myself. Watching Win32APi, I think of it, maybe it is wrong, so go back, edit, change the statement, all change it to Win32API, the problem is still. I think that I may be wrong, I should not put two DLLs, so I found a file from other machines, or the same. It's really no more possible. Just, because of the virus, you have to keep a system. When you re-run again, the miracle appears, everything is normal, and everything is OK after compiling. It turned out to be a disaster that his own function, looked at it, really feeling not easy, huh, huh.

转载请注明原文地址:https://www.9cbs.com/read-109595.html

New Post(0)