Jump to content

Cool-LV

Members
  • Posts

    117
  • Joined

  • Last visited

    Never

Posts posted by Cool-LV

  1. just remember to send 2 flags for every key pressed (0 and KEYUP) and index the array to pass the pointer to every element from the array not the pointer to arrat itself

    cosmin

    Thanks Cosmin, you are a kind man, Yup ,I knew, I used keyboard_event and mouse_event to do the sendkey exercise ago, and make SubVI, now I am using sendinput function( I have made send keystroke and mouse click SubVi with your thread ) to achieving my project. thanks your great helping ! I am full of appreciations.

  2. Hi,

    run the attached vi in highlight execution

    cosmin

    Thanks Cosmin, that is great, it works. Now I want to tell, why I use this Sendinput, not keyboard_event send key store, that is why I was asking to disable/retore title at this forums, as I use "block input" function, sendinput can help to input keys also, that is my goal that I am looking for along, but keyboard_event send key store can't do.

  3. Hi,

    work from exp below, your vi is a little messyDownload File:post-4089-1152812598.vi

    cosmin

    Thanks All,

    thanks cosmin, and I have tried your enclosed vi, I open NotePad to do the test, I highlight the Execution to run the vi, as the vi executes run action, I quickly switch the active window is NotePad, but the result is fail, no any response, no character inputted at NotePad, no matter I input wscan or wVK's count, the virtual key code is from below

    Hex code,

    Key Code

    but we can see the feedback parameter would turn to 1, what is the focal behavior ?

  4. Then read the entire MSDN article pointed to in the previous post! It mentions that GetCursor is only for the applciation cursor while there is a GetCursorInfo or similar function that will give you the global cursor (at least if you are not using an archeological Windows version).

    Rolf Kalbermatter

    thanks rolfK, and I found msdn tells "[out] Pointer to a CURSORINFO structure that receives the information. Note that you must set CURSORINFO.cbSize to sizeof(CURSORINFO) before calling this function"

    I don't undertand well about "must set CURSORINFO.cbSize to sizeof (CURSORINFO)" what is the sizeof that I must pay attenction to ?

    and I set the cbSize to any count, labVIEW prompts error dialog box. that is my error vi. would you help to point out my error at your convenience time? thanks !

    Download File:post-4703-1152159461.vi

  5. I just want to confirm, when I used Yen's method, my output file is not black-and-white, instead, it is made up of 2 colors. The .bmp file can be red with blue or yellow with green or green with white or etc.... And everytime I run the program, it will get different combinations.

    I wonder if anyone is seeing this too? Is there anyway I can do so that I will always get black and white ONLY in my .bmp file?

    Appreciate your help/assistance/comments.

    I think my sample can help you, and you can define its"size" to get bmp's pixel.

    Download File:post-4703-1152021249.vi

  6. Maybe that would be a chance to learn C? It's still THE engineering programming language and won't go away anywhere soon. Having some knowledge about C programming will always be an added bonus in almost any engineering profession where you even remotely need to get your hands on a computer.

    I'm not volunteering to write this thing for you, sorry. It's going to be a time consuming exercise in any case and to get it work exactly as you envision it will probably get a hard exercise for someone else than yourself.

    Rolf Kalbermatter

    rolfk, OK, I know, anyway, thanks for your issues. yup, they are reasonable.

  7. Changing the global cursor is not such a simple exercise. Basically Windows maintains a cursor state for each application and changes it accordingly whenever the cursor changes into a screen area owned by a different application. And in the case of LabVIEW it gets rather nasty for the application cursor. LabVIEW has the habit of resetting the cursor frequently to what it thinks it should be. But if you use LabVIEW 8 then you have already functions in the palatte to change the cursor state for at least LabVIEW.

    To change the global cursor consistently I'm afraid you would end up having to write some hook function again.

    Rolf Kalbermatter

    Thanks rolfk, but I don't want to change the global cursor, I just want to get the global cursor's status.

  8. Specifically here - this returns the handle to the current cursor - which allows you to determine its' status.

    Thanks all, I have made one "GetCurrsor" sample attached, but, it is not well, as the cursor turns to "busy" status, and the back count is not changed. the count can changed at labVIEW front panel only, if the cursor is out of labVIEW front panel, it is no response. is anything wrong ?

    please help to point out.

    Download File:post-4703-1151896776.vi

  9. The SetWindowsHookEx function takes as one of the paramaters a callback function. This is a function pointer and can only really be confortable done in C so you will have to write a DLL in C that does the hooking. The callback function will inspect the message passed to it and either modify some parameters, deny handling of the message altogether or allow handling of the message unaltered. The return value of your callback function determines if the message should be further handled or not.

    It's a low level work area and if your callback function does the wrong thing you can get your Windows system in a rather hard to control state. (Ctrl-Alt-Del) may be your only friend then or the reset button.

    Rolf Kalbermatter

    Thanks Rolf Kalbermatter, but I am not familiar with C language of this controlling . So, anybody can help to make a DLL or a sample will be great appreciation.

  10. Hi,

    as far as I know, LV does support transparancy in the picture control. ( do you mean, is background of picture control transparent ? Yes, I knew that, not the picture control's back ground that I concern, I want to display an image, example PNG image, where the image transparent where it should be, I enclosed a PNG image to you, it is a blue ball only, but it is not a ball only as it display at picture control, there are a yellow back color )

    The normal way to go would be to make a copy of the frame,

    resize the frame to the right size, insert the "middle" picture into the frame

    (overwrite the transparent part of the frame), you even don't need GIFs anymore ( Yes, this is a simple handle, but my picture frame has some flowers or stars etc decorations about, so the frame must top to the other image.)

    For the UI you could consider of using two picturecontrols (without border)

    on top of eachother to let the user choose his/her border and

    then afterwards saving the result to disk... (Yup, maybe this is the best way, but, how can I display must transparency of place image (GIF,PNG) is the focal problem)

    goodluck,

    TNT

    and I have made an example of indicator, there are my looking for along.

    post-4703-1151482803.png?width=400

    Download File:post-4703-1151484327.vi

  11. Hello,

    I am facing a project that add picture frame to a picture, namely, select different style of picture frames to a picture. how to do this ?

    and I knew "read png.vi" can read a png format image, and I have searched a llb which is QuitTime toolbox to read GIF image, but , while I read them to add to a buttom image, the "picture frame" image would cover the buttom picture, original transparent place of PNG or GIF is not transparent after read (change to black or any other color) and indicate a picture control container. how to solve it ? thanks in advance.

  12. When you build an exe you can specify the behavior of the related VIs, like removing their front panel if you're not going to show them. But surely you already knew that, after all you have seven years of LV experience, more than myself. So I think that's not what you're asking for :rolleyes: .

    When you double click a LV built-in function, you can't open it because it's not a VI. I think you are asking how to reproduce that for a VI. Am I right?

    Saludos,

    Aitor

    Thanks Aitor Solar, Yes, that is not my want,

    "When you double click a LV built-in function, you can't open it because it's not a VI. I think you are asking how to reproduce that for a VI. Am I right?"

    now, I think an enclosed llb can tell details, that is from NI China website, this vis made by Gzou, and someone had ask him how to make it, but he hasn't answered obverse and I don't know how to make this.

    Download File:post-4703-1151455067.llb

  13. Capturing events from other applications is something only doable with Windows API programming and with some involved ones too, using callbacks and such. Search MSDN for filter hooks such as the SetWindowsHookEx function does. Basically you have to install a global filter hook for the events you want to block, implement the callback function that receives the redirected events and discards them depending on the passed parameters etc. Doing this for LabVIEW will absolutely positively mean that you have to write an intermediate DLL.

    Rolf Kalbermatter

    Thanks Rolf, yup, I have searched MSDN, but I haven't got any info about my goal :headbang:

    you wrote "have to install a global filter hook for the events you want to block" is this handle only ? haven't any simple way to reach it ?

    just call an or two APIs ?

  14. It seems that the time to write a user name and password would be very short. You may not have much of an issue there. ( :)man, that is for example, not details, I am facing much field wanting to do sendkey action actually)

    In summary, you CAN lock the LabVIEW panel because the code sending the name&password would be running in the event structure. (OK, if some people click the mouse, or open the other application during the program doning sendkey process ? what would happen ? the key focus will be gone. or the active window would be changed.)

    You said these would be stored, (my store-- means that I can store the password and user name or any other informations to *.ini or *.xml file, and as I open the "sendkey application" it can load the config, then takes the sendkey action )

    so there would be no interaction on the panel. (yes, you are right) Look into event structures if you aren't familiar with them. (en....would you kindly help to make a simpel sample for me ? with this status ?!)

    You cannot lock the user from clicking on things on the web browser (as far as I know) based on your limitations.

    actually, I viewed a application can do my issues ago, I remember that software is downloaded from some website, as I doubled click it to install, that application prompts a dialog box to ask people input CD key, and I found at that time, keyboard and mouse were disabled, and can see the CD key was inputted automatically by its software, after finished input CD key, the mouse and keyboard's function were restored ,I don't know how it did.

  15. I am unsure of what you are asking. If I am correct, the LabVIEW app is sending information to the other application via the API send key functionality. The LabVIEW app is frontmost,(no , labVIEW app can do this step with minimized window) thus capturing key/mouse input. At some point the LabVIEW app will be sending information over to the other app, and you want to avoid anything happening while this occurs. But since your method of communication is through sending keyboard data, you are stuck.

    You can ignore keyboard and mouse events in your labview program by either discarding them with Filter? events are by treating them differently based on some flag set in your program.

    You can also have your code for the sendkey called within an event structure, which by default locks the Front Panel from keyboard and mouse until the event is done being serviced. This may be what you are asking. (no, I can't lock the front panel, because, if you do this, how can you send the key to the other appliction ?)

    If you want to prevent the user from changing focus from your LabVIEW app to another app or Windows toolbar, etc. then I have nothing to offer.

    David

    Thanks ! OK, for details, let me tell a sample

    I want to program a function, it can help me to input user name and password, and this input field is from a web, cause this web that I am using frequently, and I don't want to input it manual, my goal is that open a labVIEW app(it can store my user name and password), and click a button, then program helps to input "user name and password, within program inputting time, for prevent people to move mouse or click keyboard, so I want to disable them " , am I clear ?

  16. As my subject, how to disable/restore keyboard or a mouse function ? and I know using User32.dll a "blockinput" function can block all of inputs, but this is not my goal, since I use send key function, namely, program auto inputs characters to the other application (not labVIEW application, so discard event function can't achieve this goal, have to use API ) instead of manual, and I want to disable keyboard and mouse function to avoid people inputting before program is doing auto sendkey process. and "blockinput" function would block every inputs too, program sends key fail, anybody can help would be great appreciation ! :worship:

  17. hello,

    As I use "Open URL in default Brower.vi" ,I found it can open an URL address. but, As I want to open the other address( The other URL) , this vi will replace the openned one, can this vi open(create) a new window ? not replace openned window ? or do you have any good suggestion about openning URL , thanks in advance.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.