Disable the button "Close" command through LabVIEW prompt by using the Win32 API

Hi all

I'm trying to disable the close button of a third party console application which I invoke with LabVIEW. I tried to use GetSystemMenu() and DeleteSystemMenu() user32.dll, but somewhere I'm doing it wrong.

Can anyone suggest a solution to this?

Thank you!

FraggerFox

You have the window handle?  Hand, I don't know how to remove it, but here is a code c# I used to gray on the close button the window in another project:

[DllImport ("user32.dll")]
private static extern IntPtr GetSystemMenu (IntPtr hWnd, bool bRevert);
[DllImport ("user32.dll")]
private static extern bool EnableMenuItem (IntPtr hMenu, uint uIDEnableItem,
uint uEnable);

private const Int32 SC_CLOSE is 0xF060;.
private const UInt32 MF_BYCOMMAND = 0 x 00000000;
private const UInt32 MF_ENABLED = 0 x 00000000;
private const UInt32 MF_GRAYED = 0 x 00000001;
private const UInt32 MF_DISABLED = 0 x 00000002;
private void EnableClose (Boolean enable)
{
IntPtr pSysMenu = GetSystemMenu (Handle, false);
If (pSysMenu! = null)
{
EnableMenuItem (pSysMenu, SC_CLOSE, MF_BYCOMMAND |) (activate? MF_ENABLED: MF_DISABLED));
}
}

It was easy enough to convert more than once I had the handle (it's a library, I picked up somewhere).

I hope this helps.

A

Tags: NI Software

Similar Questions

  • The Win32 Api hook

    I did a scan Trend Micro Housecall, he said: I have 1 problem he can't fix: Hooked_Service_API, Service Api: ZwTerminateProcess

    Image path: C:\Windows\System32\Drivers\SPINProc.sys

    Manager of origin: Service 0x805c866a CurrentHandler 0xeee9f416 number 0 x 101

    ModuleName Psinproc.sys

    SDTType 0x0

    From what I know about it, that it is spyware or viruses, that modifies the behavior of the pc during the game, which is exactly the problem that I had lately, but I can't find a solution to remove.  I ran several other scans, they found, but all say that they can not fix it.

    I have windows xp pro 32 bit on my pc

    Hello
    Try the sequence of steps 1 and 2 in this virus/malware removal guide: http://www.selectrealsecurity.com/malware-removal-guide
    It provides detailed instructions on how to remove malware from a computer. If you have any questions, just ask. I hope this helps you.
    Brian
  • The Windows API in LabWindows 9.0 documentation

    I installed LabWindows/CVI 9.0 to ensure that the Windows SDK is enable.  When I help/Win32 API, I get the following error message:

    "The Win32 API documentation has not been installed.  You can install the documentation for "MSDN Library" DVD included with LabWindows/CVI. »

    I download the setup of LabWindows/CVI on the site.  How can I obtain documentation?

    Paul

    Thanks, I download it from the Web site of OR or wait for the next update of the watch.

  • Disable the close button in ChildBrowser

    I'm working on a project that deals with pages and external links.

    How can I disable the 'Close' button on the Webworks ChildBrowser and re-enable it after loading the page.

    Thank you for your response.

    Hello

    To confirm, you mean that sheet of 10 of BlackBerry that slides in to view content, correct? If so, the ChildBrowser is a component of system level and only provides access to its user interface.

  • How to disable the close button during execution

    Hello world.

    Please help me how to disable the close button at the top of the window during execution. I don't want the user to use this button to close. I used the button called out in this form but sometimes users of closing by clicking this button.

    I use the formula of Oracle 10 g R1.

    Thanks in advance,

    Or if you want to stop the closing by button close the main WINDOW. Then create a trigger on called KEY-OUTPUT at the FORM LEVEL and just write the value NULL ex.

    Trigger = KEY-EXIT (FORM-LEVEL)
    NULL;
    

    -Clément

  • How to enable / disable the component af:table command button

    Hello

    I use JDev 11.1.2.4.

    I have a table that looks like this

    Action ChainCount

    button 1

    5 key

    0 key

    0 key

    I want to disable the buttons when the value in column 2 is 0.

    I tried setting off of the button property

    #{bindings. {RtnOSPickwave1.children.ChainCount.inputValue lt 1}

    #{bindings. {RtnOSPickwave1.collectionModel.bindings.ChainCount.inputValue lt 1}

    #{bindings. {RtnOSPickwave1.collectionModel.ChainCount.inputValue lt 1}

    but no luck.

    any ideas?

    Thank you

    Try then with #{rank. {ChainCount lt 1}. If it does not, after the opening of the tag.

    Dimitar

  • Disable minimize or close button on the client to view

    Hello

    I hope this is the right forum for this question. I couldn't find the info I was looking for by searching online.

    Is it possible to disable the maximize/minimize/disconnect button in the top bar after that which appears after login to any computer virtual? I use VMWare View client 4.6. If you need more information, please let me know. Thank you

    If I'm not mistaken, I think what you want is - this setting:

    'Enable the shadow '.

    Determines whether the menu bar of shadow at the top of the View Client window is visible. This setting is enabled by default. NOTE the shadow menu bar is disabled by default for the kiosk mode.

  • read com ports with command-line through labview?

    I'm trying to find a way to get a specific com port through the command via the command exec system prompt in labview. Is it possible to get the list of com port connections just like one you see in Device Manager where he will give the list the name of the device connected to a certain com port? I want to be able to automatically find the port com for a specific device.

    because it is a virtual com port that gets set up and I tried the vi to find resources VISA and it did not work. However, funny enough, just after I submitted this post, I found the solution to my problem. If you use exec system and type this command in the standard input:

    WMIC path Win32_SerialPort

    This will bring up a list of all com ports connected and very fast too. From there I can analyze the information I want and widdle down to the com of the desired usb device port.

    Maybe this can help someone on the road.

  • Position of the button close the tab tab

    Just updated to 17 of Firefox on my Windows 7 PC. The close tab buttons are now on the left side of the tab instead of the right side. How can I move them back on the right side? I can't find other help on this and tried to play with: config userchrome, but nothing is. I can change the color, add a button in the bar, but does not affect the positioning of the buttons close the tab on the tabs themselves.

    Help!

    You have the module / theme / userstyle installed that controls tab behavior? You can resolve this problem by restarting with disabled modules. You can also reset firefox who, most likely, your problem will be solved.

  • How to disable the MATLAB command window when the Matlab Script

    Hi, is it possible to disable the MATLAB command window popup when the Matlab script? Thank you.

    Isn't fear. As soon as you close the window is closed by the ActiveX Server and your script will stop running. You can, of course, reduce by using the operating system. Under Windows, you can use the Utilities of Windows API, as provided for in one of the threads of research responses.

  • How to disable the command CHKDSK - Check Disk start up for Windows 7

    I have some problems, when I start my laptop I am prompted with a black screen saying

    I found no solutions on how to disable this on my computer, but I want to because after the seconds say 1, its stays for a while... and I've left on during some time, the screen is still asleep when I turn... The page is black... Can someone help me to disable the calendar checking for windows 7? Thank you very much! : D

    Hi PikaBrian,

    Welcome to the Microsoft Answers site!

    To disable automatic disk checking at the start of Windows through registry, go to the following registry key:

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    322756 how to back up and restore the registry in Windows: http://support.microsoft.com/kb/322756

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

    In the right pane, double click BootExecute.

    The default value of the key is autocheck autochk *

    * means that each drive is checked for consistency. Just add /K:C to the end before *. /K switch will disable autocheck on C: drive at Windows startup. If the final value should look like this:

    / k: C to autocheck autochk *.

    If you want to add more drives, the key should look like this: (by disabling the drives C and D)

    / k: D / k: C autocheck autochk *.

    If you want to restore all default, just replace the key with the default i.e.

    autocheck autochk *.

    You can also follow the link given below and check if it is of no help.

    http://social.answers.Microsoft.com/forums/en-us/vistaperformance/thread/a8ab415b-4559-45C6-99a4-a54e27e5a836

     

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I disable the guest user to close the PC while the Admin is connected?

    I'm running Windows 7 Ultimate. I found out how to disable the guest user closing at all via the local security policy, but then they can't stop even if the Admin account is offline.

    To clarify a bit, say I want to give my PC to someone, I usually click on change user and connect using the guest account. In this way, they can't access my account because it asks for a password. I want that in such a case, they should not be able to stop the PC as my admin account is always logged.

    However, if someone booted the PC themselves and use the guest account, then they should be able to close too, as my Admin account has not been connected.

    I'm running Windows 7 Ultimate. I discovered how to disable the guest user closing all through local security policy.

    It is the correct method. It is as robust as it is unconditional.

    If you want to have your cake and eat it the guest account must use a powerful "agent" to perform the functions of judgment. A scheduled task would be such an agent. It might work as follows:

    1. Create a scheduled task that runs Script1 to perform these tasks:
      -Check if the C:\Shutdown\Shutdown.txt file exists.
      -If not, the output of the script.
      -If this is the case, delete Shutdown.txt.
      -Check if there is an administrator session. If so, the output of the script.
      S ' there is no live administrator session, shut down the computer by using shutdown.exe.
      The task must run under an administrator account once every 3 minutes.
    2. Create a shortcut on the desktop for the Guest user calling Script2 for these tasks:
      -Check if there is an administrator session.
      -If this is the case, create a pop-up to inform the user that the machine cannot be stopped.
      -If it is not, create the C:\Shutdown\Shutdown.txt file. The scheduled task will 'see' this file and will stop the machine.
  • How to trigger DA when the user clicks a button close the standard window

    Hello!

    Apex 5.0 & universal theme.

    I want to trigger some DA when the user clicks on the button indicated to my image (button close the standard window). In fact, I would like to pass a value of my hidden form IR back and refresh IR if value = 1 or don't refresh with another value.

    Is this possible?

    Thank you.

    close_form.png

    Hi Yava,

    Seems that you have chosen to add the event handler to the page parent (the one with the IR). I think it's best. This means that the code above does not apply.

    The dialogclose event and all other dialogue jQuery UI events are triggered in the dialog box to create a DA pull on the IR will not work (because the dialog box is outside the IRR while she bubbles it won't go through the SORTING). You must handle the event on the body. This works because the event propagates to the body. Set the Type to choose to be "jQuery Selector". JQuery Selector enter 'body' (without the quotes). The event you want to handle is a custom, event which means that this isn't one of those in the select list. For event, choose "Custom". Then enter Custom Event "dialogclose" (without the quotes). Now you have a DA who fires when * all * dialog closes. You may or may not need to get more selective than that. For action, you can use refresh as you do already.

    Kind regards

    -John

  • disable the button if the table is filtered

    Hello
    I have a command button and a table of the adf on a jspx page.
    I keep the filtering enabled for the table.

    My requirement is I have to disable the button if the table is filtered and as soon as table becomes 'normal' or a filtered ' I should activate this button.
    can anyone suggest a way to implement this use case?

    Thank you.

    Just add a listener of the request at the table that is called whenever the query is filtered. Detect if the filter criteria list is empty and refresh your button accordingly

    public void queryListener (QueryEvent queryEvent)
    {
    FilterableQueryDescriptor desc = queryEvent.getDescriptor ((FilterableQueryDescriptor));

    Card filterCriteria = desc.getFilterCriteria ();

    Refresh your button here.

    call listener default query to run the query
    Object query = JSFUtils.resolveExpression ("#{bindings.") MyROViewQuery}");
    (Query) .processQuery (queryEvent) (FacesCtrlSearchBinding);
    }

    to avoid using the class FacesCtrlSearchBinding uses the example of
    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/30-table-filter-queries-169172.PDF

    () invokeMethodExpression
    "#{bindings." DepartmentsView1Query.processQuery} «»
    Object.Class, QueryEvent.Class, queryEvent);
    }

    Published by: Don Kleppinger on June 4, 2013 12:02

  • Need to disable the button until all the elements of the array was posted

    Hello

    I get a lot of help from this Forum, thought about getting more out of it. I am very new to AS3 and to do my best to get as much as I can that are still a few problems to come through.

    I am trying to disable the button on a specific image until all the Clips of film in a table are bieng is displayed, otherwise it should show another clip from movie plurarite the message that all video Clips are not displayed.

    Here's the scenario-

    SUMMARY.

    There are three buttons on the stage, the next image button, button to load the 1st Movie Clip (note1), button to load the second film Clip (note2)

    I'm counting the Clips of film with the length of the array (I don't know if I'm doing things), but the idea is that once all the video clips are loaded, next picture button must be activated in the case otherwise he must remain inactive, rather would display another clip of film as notice that all Clips are not loaded)

    Here is my Code.

    import flash.events.MouseEvent;

    btnnxt.mouseEnabled = false;

    var note1:Mc_Notice1 = new Mc_Notice1;

    var note2:Mc_Notice2 = new Mc_Notice2;

    function next(Event:MouseEvent):void

    {

    if(Count.Length == 2)

    {

    btnnxt.mouseEnabled = true;

    nextFrame();

    trace ("mouse is on");

    }

    else {}

    btnnxt.mouseEnabled = false;

    }

    }

    notes of the var: Array = [note1, note 2, note3];

    var numbers: Array = new Array();

    btnnxt.addEventListener (MouseEvent.CLICK, next);

    btnload1.addEventListener (MouseEvent.CLICK, hearings1);

    btnload2.addEventListener (MouseEvent.CLICK, load2);

    function load1(Event:MouseEvent):void

    {

    addChild (notes [0]);

    Notes [0] .x = 100;

    Notes [0] there = 100;

    Count.push (1);

    trace ('Count' + count.length);

    }

    function load2(Event:MouseEvent):void {}

    addChild (notes [1]);

    Notes [0] .x = 100;

    Notes [0] there = 100;

    Count.push (1);

    trace (counting);

    count0 = 1;

    trace (count.length);

    }

    Please help in fixing this error that I do not receive the required results.

    Help, please.

    Best regards

    Part of the problem is that you try to count by clicking a disabled button to activate this button.  As long as the button is disabled you can not use it for himself.  Instead of adding an event listener to btnnxt immediately, just assign it when it is ready to be used.  Whenever you load you need to check the value of the counter and if it is equal to 2, then you can assign the event listener for the btnnxt.

    You do not have a (County) table for that since you're using only its length property... a simple integer value will suffice.

    As I do not see you create a variable named note3, you probably get an error for this.

    In your function load2 you always aim the remark 1 placement where it should be placed.

Maybe you are looking for