Invoke and get focus

does it have a way to make an application get activate when luanch second time application?
Default: it flashes icon in the task bar. Window is show but does not get a focus.
Ex.
1. start Twhirl (Twitter client)
2. double click Twhirl icon again
3. now, it flashes the Twhirl icon in task bar but the application does not get a focus.
Some Related Doc:
http://livedocs.adobe.com/flex/3/html/help.html?content=taskbar_1.html

Hi Bibhu,
Thanks for acknowleding my issue and sorry for my bad that I could not describe the issue correctly.
Let me try it once again
Actually in above screenshot, there are three panels( lets call them 1A, 1B and 1C). When i Click on "moveup" button on panel 1B. The 1B panel position got swaped with 1A panel ( i used instancemanger.moveInstance(?,?);) but my mouse pointer was on the same position to form (i.e x,y) not on the 1B panel. I want to stick position of my mouse pointer on the same button of same panel where i clicked (i.e on 'MoveUp' button of 1B panel where i clicked) which has been move on top of 1A panel).
I hope i could explain it properly now? Let me know.
Regards
Sunil

Similar Messages

  • Setting and getting focus on controls

    hi experts
    how can i set focus on a control (e.g. like on a button)
    Ashish

    hi bill
    i tried using the focus listener but some problems are there.
    plz take a look at following applet code. that messageboxes
    in both the focus events keep on flashing . what must be the
    problem.plz let me know.
    Sorry for the identation of code, the code is idented properly
    in my file but in this box it appears like this only.
    Ashish
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    /*<applet code="w_passwd" width = 300 height = 300>
    </applet>*/
    public class w_passwd extends Applet implements ActionListener,FocusListener {
    Label st_2;
    Label st_1;
    TextField sle_2;
    TextField sle_1;
    Button cb_2;
    Button cb_1;
    JPanel button_panel;
    JPanel cbox_panel;
    JPanel label_panel;
    JPanel sle_panel;
    public void init(){
    label_panel=new JPanel();
    label_panel.setLayout(new BoxLayout(label_panel, BoxLayout.Y_AXIS));
    sle_panel=new JPanel();
    sle_panel.setLayout(new BoxLayout(sle_panel, BoxLayout.Y_AXIS));
    button_panel = new JPanel();
    button_panel.setLayout(new BoxLayout(button_panel, BoxLayout.Y_AXIS));
    cb_1 = new Button( "Ok");
    add(cb_1);
    cb_1.addActionListener(this);
    button_panel.add(cb_1);
    cb_2 = new Button( "Cancel");
    add(cb_2);
    cb_2.addActionListener(this);
    button_panel.add(cb_2);
    sle_1 = new TextField(20);
    add(sle_1);
    sle_panel.add(sle_1);
    sle_2 = new TextField(20);
    sle_2.setEchoChar('*');
    add(sle_2);
    sle_panel.add(sle_2);
    st_1 = new Label( "Name");
    add(st_1);
    label_panel.add(st_1);
    st_2 = new Label( "Password");
    add(st_2);
    label_panel.add(st_2);
    cb_2.addFocusListener(this);
    add(label_panel);
    add(button_panel);
    add(sle_panel);
    public void actionPerformed(ActionEvent ae){
    String action = ae.getActionCommand();
    if (action.equals( "Cancel"))
    if (action.equals( "Ok"))
    JOptionPane.showMessageDialog(null,"hello there");
    public void focusGained(FocusEvent fe)
         if (cb_2.hasFocus())
         JOptionPane.showMessageDialog(null,"got focus");     
    public void focusLost(FocusEvent fe)
         Object source = fe.getSource();
         if (source instanceof Button)
              JOptionPane.showMessageDialog(null,"lost focus");

  • When I invoke Itunes I get an "error 7 (Windows 193)" message. I have reinstalled twice and get the same message. I have Windows 7 64 bit machine. Can someone help?

    When I invoke Itunes I get an "error 7 (Windows 193)" message. I have reinstalled twice and get the same message. I have Windows 7 64 bit machine. Can someone help?

    Uninstall your existing copy of iTunes. Delete any copies of the iTunesSetup.exe (or iTunes64Setup.exe) installer files from your downloads areas for your web browsers and download a fresh copy of the iTunes installer from the Apple website:
    http://www.apple.com/itunes/download/
    (The current build of the 11.1.4.62 installer was changed a few days ago, which fixed the bulk of the reports of MSVCR80.dll/R6034/APSDaemon.exe/Error-7/AMDS-could-not-start trouble ... but the build number on the installer was not changed. So we're trying to make sure you do the reinstall using a "new good" 11.1.4.62 installer instead of an "old bad".)
    Does the install with the new copy of the installer go through properly? If so, does that clear up the error message?
    If you still have the same error messages cropping up, then try the procedures from the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • JTextField and JTextArea don't get focus occuasionally

    I am developing a Java Swing Applet. At edit mode, JComboBox, JCheckBox, JRadioBox, and JButton work fine, but JTextField and JTextArea can't get focus occuasionally while I click them.
    Anyone has idea?
    Thanks

    Thank you Himanshu,
    but that's not exactly what my issue is. This link describes the undesired effect of ending up outisde of the player window and in the browser.
    My problem is kind of the opposite. When I launch the page in the html file I cannot use the tab key to get to any of the controls in the captivate window. I'm stuck in the browser unless I click on the captivate window. That is not acceptable if we want it accessible without using a mouse. I found a way to make it work for chrome like I stated above, but not in FF. Do you have any ideas for this?
    Thanks!
    Monique

  • Invoke BAPI and get response

    Hi all,
    i would know if exist some example of invoke BAPI and get a response in a BizStep, or is necessary implement the flow by hand in Main.bfd.
    The communication is from B1 to ECC.
    Regards

    Hi,
    Anyone can help or give some suggestion? Thanks!
    Alva

  • Problem in getting and setting focus on an item in j2me

    hi all,
    i wanna get focus on an item when a user selects it can any one tell me is there any class in j2me for doing so
    thx

    Hi,
    :. It's not exactly what you want, but it can bring some light to the
    matter.
    const char *JstrToChar( JNIEnv *env, jstring jstr )
      if( jstr != NULL ) return (*env)->GetStringUTFChars( env, jstr, NULL );
      else               return NULL;
    int JarrLength( JNIEnv *env, jobjectArray oarr )
      if( oarr != NULL ) return (*env)->GetArrayLength( env, oarr );
      else               return 0;
    void freeJstr( JNIEnv *env, jstring jstr, const char *p )
      if( p != NULL ) (*env)->ReleaseStringUTFChars( env, jstr, p );
    JNIEXPORT void JNICALL showArray( JNIEnv *env, jobject self, jobjectArray jv_oarr )
      register int      iCt;
      jclass      jv_clsstr;
      jobject      jv_obj;
      int           iLen;
      const char      *content;
      iLen = JarrLength( env, jv_oarr );
      if( (jv_clsstr = (*env)->FindClass( env, "java/lang/String" )) != NULL )
        for( iCt = 0; iCt < iLen; iCt++ )
          jv_obj = (*env)->GetObjectArrayElement( env, jv_oarr, iCt );
          if( (*env)->IsInstanceOf(env, jv_obj, jv_clsstr) )
            content = JstrToChar(env, (jstring)jv_obj);
         fprintf( stderr, "Just testing. Param[%i]=%s\n", iCt, content );
            freeJstr( env, (jstring)jv_obj, content );
      else fprintf( stderr, "Error on finding class String!\n" );
    :. Meanwhile inside Java code...
    public native void showArray( Object[] arr );
    :. I sent an array of Objects instead of Strings, as you can see.
    Also the above sample was modified in a hurry, so it can bring small
    errors of typing. Hope it helps.Roque

  • Disabled button getting focus

    My problem is that a disabled button are getting focus, which is bad when the application are operated without a mouse.
    I made this litlte demo to illustrate the problem.
    Try pressing button no.1. This will disable button no.1 and button no.2,
    but why are button no.2 getting focus afterwards?
    * NewJFrame.java
    * Created on 29. september 2005, 16:55
    import javax.swing.*;
    * @author  Peter
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
            printButtonStatus();
        private void printButtonStatus () {
            printFocus (jButton1);
            printFocus (jButton2);
            printFocus (jButton3);
            printFocus (jButton4);
         * Just debug inf.
        private void printFocus (JButton button) {
            System.out.println ("Button=<" + button.getText () + ">, Enabled=<" + button.isEnabled() + ">, Focus=<" + button.isFocusable() + ">");
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        private void initComponents() {
            jPanel1 = new javax.swing.JPanel();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jPanel2 = new javax.swing.JPanel();
            jButton4 = new javax.swing.JButton();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jButton1.setText("jButton1");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jPanel1.add(jButton1);
            jButton2.setText("jButton2");
            jPanel1.add(jButton2);
            jButton3.setText("jButton3");
            jPanel1.add(jButton3);
            getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
            jButton4.setText("jButton1");
            jPanel2.add(jButton4);
            getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
            pack();
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            // TODO add your handling code here:       
            jButton1.setEnabled(false);
            jButton2.setEnabled(false);
            jButton3.setEnabled(false);
            printButtonStatus();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton4;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        // End of variables declaration
    }

    Very courius.
    I have made a little change in your code.
    1) scenario
    Simply changing .setEnabled(false) invokation, the class works fine.
    so
    jButton2.setEnabled(false);
    jButton3.setEnabled(false);
    jButton1.setEnabled(false);
    2) scenario
    the class works fine also using your .setEnabled(false) order invokations and putting after those:
    FocusManager.getCurrentManager().focusNextComponent();
    I do not know exactly why, I suppose that is there something not properly
    syncronized in events dispaching.
    In my opinion:
    a) setEnabled(false) at last calls for setEnabled(false) of JComponent
    that fires a propertyChange event
    so:
    scenario 1)
    buttons 2 and 3 are disabled before of button1 that has the focus in
    that moment (given by a the mouse click on itself)
    When botton1.setEnabled(false) is performed buttons 2 and 3 are
    just disabled, so focus is got by button4 (that is enabled)
    scenario 2)
    button1 that has the focus (given it by the mouse click) becames
    disabled before that button2 becames disabled too.
    So, probably, when the event of PropertyChanged is fired and processed, button2.setEnabled(false) invokation has not been
    just performed and swings looks for it as a focusable component
    So, using FocusManager.getCurrentManager().focusNextComponent(),
    we force the transer focus on next focusable component.
    This is only a my suppose, looking what happens.
    Regards.
    import javax.swing.*;
    * @author Peter
    public class NewJFrame extends javax.swing.JFrame {
    /** Creates new form NewJFrame */
    public NewJFrame() {
    initComponents();
    private void printButtonStatus () {
    printFocus (jButton1);
    printFocus (jButton2);
    printFocus (jButton3);
    printFocus (jButton4);
    System.out.println("--------------------------------");
    * Just debug inf.
    private void printFocus (JButton button) {
    System.out.println ("Button=<" + button.getText () + ">, Enabled=<" + button.isEnabled() + ">, Focus=<" + button.hasFocus() + ">, Focusable=<" + button.isFocusable() + ">");
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jButton4 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jButton1.setText("jButton1");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jPanel1.add(jButton1);
    jButton2.setText("jButton2");
    jPanel1.add(jButton2);
    jButton3.setText("jButton3");
    jPanel1.add(jButton3);
    getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
    jButton4.setText("jButton1");
    jPanel2.add(jButton4);
    getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
    pack();
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    // I have simply change the order
    jButton2.setEnabled(false);
    jButton3.setEnabled(false);
    jButton1.setEnabled(false);
    // with this sentence the class work with original .setEnabled order
    //FocusManager.getCurrentManager().focusNextComponent();
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    printButtonStatus();
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new NewJFrame().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration
    }

  • JSpinner getting focus?

    I'm trying something that I thought should be simple, but it doesn't seem to work.
    I would like to be notified when a spinner gets focus, so I added a FocusListener to the JSpinner involved. The FocusGained and FocusLost methods in the FocusListener were not invoked when I tabbed through the spinner, nor when I clicked on its text field. The spinner is focusable and enabled.
    Then I thought that maybe I had to monitor the editor instead, so I tried adding the FocusListener to the JSpinner's editor. No luck there either.
    I think I must be missing something elementary. If what I tried should have worked, I'll post the code here so that someone can point out my error.
    Thanks
    Jon

    Hi,
    you don't want to be informed when the JSpinner gets the focus (by default the JSpinner is not focusable), but when the text field gets the focus. So you have to add your FocusListener like this:
    JSpinner js = new JSpinner();
    ((JSpinner.DefaultEditor)js.getEditor()).getTextField().addFocusListener(new MyFocusListener());You should not make the JSpinner focusable 'cause then the user has to type the tab-key twice to enter the JSpinner's text field.
    Andre

  • Connection to CRX via RMI and getting WeakReference value..... with an exception!

    Hi there,
    I have the following problem.
    I opened a ticket in Day Care Support system, about CRX users/group membership that got lost while synchronization with our LDAP server.
    Although when the user and the group had been created (and therefore taken from that same LDAP server), the membership was good.... but after some time the membership got lost......
    So what i am trying to do now is a Java program that connects to CRX via RMI.
    And gets the list of all the users from a group (aka membership).
    The idea is to monitor the membership each seconds.
    But when trying to get the property "rep:members" of the group, I have the following exception :
    javax.jcr.ValueFormatException: Unknown value type 10
              at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:13 9)
              at org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
              at java.lang.reflect.Method.invoke(Method.java:611)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)"
    I searched a little bit and found that "10" is the number for type WeakReference.
    That's normal to me because memberships are stored in the group as a list reference to users linked to that group....
    Anyways, what's not normal to me is that when the type is "10" the API does not let me get the Value (cf. ServerProperty.getValues() method)
    Here is the program:
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Map;
    import javax.imageio.spi.ServiceRegistry;
    import javax.jcr.Node;
    import javax.jcr.NodeIterator;
    import javax.jcr.Property;
    import javax.jcr.PropertyIterator;
    import javax.jcr.Repository;
    import javax.jcr.RepositoryException;
    import javax.jcr.RepositoryFactory;
    import javax.jcr.Session;
    import javax.jcr.SimpleCredentials;
    import javax.jcr.Value;
    public class Test {
              public static void main(String[] args) {
                        String uri = "rmi://sma11c02.............:1234/crx";
                        String username = "admin";
                        char[] password = {....................};
                        String workspace = "crx.default";
                        String nodePath = "/home/groups/a";
                        Repository repository = null;
                        Session session = null;
                        try {
                                  // Connection to repository via RMI
                                            Map<String, String> jcrParameters = new HashMap<String, String>();
                                            jcrParameters.put("org.apache.jackrabbit.repository.uri", uri);
                                            Iterator<RepositoryFactory> iterator = ServiceRegistry.lookupProviders(RepositoryFactory.class);
                                            while (null == repository && iterator.hasNext()) {
                                                      repository = iterator.next().getRepository(jcrParameters);
                                  if (repository == null) {
                                            throw new IllegalStateException("Problem with connection to the repository...");
                                  // Creation of a session to the workspace
                                  session = repository.login(new SimpleCredentials(username, password), workspace);
                                  if (session == null) {
                                            throw new IllegalStateException("Problem with creation of session to the workspace...");
                                  // Get the targetted node
                                  Node node = session.getNode(nodePath);
                                  System.out.println("Node : " + node.getName());
                                  System.out.println();
                                  PropertyIterator properties = node.getProperties();
                                  System.out.println("List of properties for this node :");
                                  while (properties.hasNext()) {
                                            Property property = properties.nextProperty();
                                            System.out.print("\t"+property.getName() + " : ");
                                            if (property.isMultiple()) {
                                                      Value[] values = property.getValues();
                                                      for (int i = 0; i < values.length; i++) {
                                                                System.out.print(values[i]);
                                                                if (i+1 != values.length) {
                                                                          System.out.print(", ");
                                                      System.out.println();
                                            } else {
                                                      Value value = property.getValue();
                                                      System.out.println(value);
                                  System.out.println();
                                  NodeIterator kids = node.getNodes();
                                  System.out.println("List of children nodes for this node :");
                                  while (kids.hasNext()) {
                                            Node kid = kids.nextNode();
                                            System.out.println("\tChild node : "+kid.getName());
                                            PropertyIterator kidProperties = kid.getProperties();
                                            System.out.println("List of properties for this child :");
                                            while (kidProperties.hasNext()) {
                                                      Property property = kidProperties.nextProperty();
                                                      System.out.print("\t"+property.getName() + " : ");
                                                      if (property.isMultiple()) {
                                                                Value[] values = property.getValues();
                                                                for (int i = 0; i < values.length; i++) {
                                                                          System.out.print(values[i]);
                                                                          if (i+1 != values.length) {
                                                                                    System.out.print(", ");
                                                                System.out.println();
                                                      } else {
                                                                Value value = property.getValue();
                                                                System.out.println(value);
                                            System.out.println();
                        } catch (RepositoryException e) {
                                  e.printStackTrace();
                        } finally {
                                  if (session != null) {
                                            session.logout();
    Here is the output of the below program:
    Node : a
    List of properties for this node :
              jcr:createdBy : admin
              jcr:mixinTypes : mix:lockable
              jcr:created : 2011-10-25T16:58:48.140+02:00
              jcr:primaryType : rep:AuthorizableFolder
    List of children nodes for this node :
              Child node : administrators
    List of properties for this child :
              jcr:createdBy : admin
              rep:principalName : administrators
              rep:members : javax.jcr.ValueFormatException: Unknown value type 10
              at org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:13 9)
              at org.apache.jackrabbit.rmi.server.ServerProperty.getValues(ServerProperty.java:71)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
              at java.lang.reflect.Method.invoke(Method.java:611)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
              at sun.rmi.transport.Transport$1.run(Transport.java:171)
              at java.security.AccessController.doPrivileged(AccessController.java:284)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:167)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:547)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:802)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:661)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
              at java.lang.Thread.run(Thread.java:736)
              at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
              at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
              at sun.rmi.server.UnicastRef.invoke(Unknown Source)
              at org.apache.jackrabbit.rmi.server.ServerProperty_Stub.getValues(Unknown Source)
              at org.apache.jackrabbit.rmi.client.ClientProperty.getValues(ClientProperty.java:173)
              at Test.main(Test.java:96)
    Here is the list of jar files i'm using with this program:
              2862818581          61388           crx-rmi-2.2.0.jar
              732434195           335603           jackrabbit-jcr-commons-2.4.0.jar
              1107929681           411330           jackrabbit-jcr-rmi-2.4.0.jar
              3096295771           69246           jcr-2.0.jar
              1206850944           367444           log4j-1.2.14.jar
              685167282           25962           slf4j-api-1.6.4.jar
              2025068856           9748           slf4j-log4j12-1.6.4.jar
    Finally, we are using CQ 5.4 (CRX 2.2) with the latest hotfix and under Websphere 7.0
    Best regards,
    Vincent FINET

    Je suis absent(e) du bureau jusqu'au 17/04/2012
    Je suis absent.
    Je répondrai à votre sollicitation à mon retour le 17 avril 2012.
    Cordialement,
    Vincent FINET
    Remarque : ceci est une réponse automatique à votre message  "[CQ5]
    Connection to CRX via RMI and getting WeakReference value..... with an
    exception!" envoyé le 13/4/12 0:32:14.
    C'est la seule notification que vous recevrez pendant l'absence de cette
    personne.
    Le papier est un bien precieux, ne le gaspillez pas. N'imprimez ce document que si vous en avez vraiment besoin !
    Ce message est confidentiel.
    Sous reserve de tout accord conclu par ecrit entre vous et La Banque Postale, son contenu ne represente en aucun cas un engagement de la part de La Banque Postale.
    Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement.
    Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur.

  • OPENING AND GETTING MS WORD ACTIVE DOCUMENT THROUGH CLIENT_OLE2

    I am opening a word document through webutil host command. Now I need to get the active document of the opened word file.
    How it is possible?. Since I need to fire Callback trigger 'MY_TRIGGER' I can not define 'Word.Application' and get the
    'ACTIVEDOCUMENT'.
    DECLARE
    PID WEBUTIL_HOST.PROCESS_ID;
    app CLIENT_ole2.OBJ_TYPE;
    ADOC CLIENT_ole2.OBJ_TYPE;
    BEGIN
    PID := WEBUTIL_HOST.NonBlocking_With_Callback('D:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE C:\MYWORD.DOC','MY_TRIGGER');
    --APP := CLIENT_OLE2.CREATE_OBJ('WORD.APPLICATION');     
    --ADOC := CLIENT_OLE2.INVOKE_OBJ(APP,'ACTIVEDOCUMENT');          
    END;

    hi
    i did not get u very well but i am trying to help u.what do u want to achieve?
    check this code.
    DECLARE
    app CLIENT_OLE2.OBJ_TYPE;
    docs CLIENT_OLE2.OBJ_TYPE;
    doc CLIENT_OLE2.OBJ_TYPE;
    selection CLIENT_OLE2.OBJ_TYPE;
    args CLIENT_OLE2.LIST_TYPE;
    BEGIN
    -- create a new document
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    CLIENT_OLE2.SET_PROPERTY(app,'Visible',1);
    docs := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Documents');
    doc := CLIENT_OLE2.INVOKE_OBJ(docs, 'add');
    selection := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Selection');
    -- insert data into new document from long item
    CLIENT_OLE2.SET_PROPERTY(selection, 'Text', :long_item);
    -- save document as example.doc
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 'c:\temp\example.doc');
    CLIENT_OLE2.INVOKE(doc, 'SaveAs', args);
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    -- close example.doc
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 0);
    CLIENT_OLE2.INVOKE(doc, 'Close', args);
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    CLIENT_OLE2.RELEASE_OBJ(selection);
    CLIENT_OLE2.RELEASE_OBJ(doc);
    CLIENT_OLE2.RELEASE_OBJ(docs);
    -- exit MSWord
    CLIENT_OLE2.INVOKE(app,'Quit');
    END;sarah

  • JButton & Win XP Look and Feel focus rectangle bug??

    I searched the bug database but was unable to find any matches...
    I have received a bug report from our users relating to mistakenly thinking a button has focus. In the XP LAF, when a button is a 'default' button, it has a blue rectancle drawn around it (which is correct). When you tab to that button however, there is no additional 'focus' rectangle to indicate that the button has focus. I tested this in native XP components and an additional rectancle IS drawn when the button gets focus (in addition to the blue rectangle). Shouldn't there be some sort of focus indicator in addition to the blue rectangle? I'm using JRE version 1.4.2_02.
    Thanks,
    Andy

    Hello Andy!
    If the behavior of Win XP LAF is different from the native this is definitely a bug. It would be greate if you file a bug here
    http://java.sun.com/webapps/bugreport.
    Thank you.
    Anton

  • Avoid window getting focus after pressing a mouse button on it

    I want that a window does not get focus although I press a mouse button on it, in Windows XP.
    I have search in Microsoft help and this fact is controlled by the Operating System itself. The notification that is sent after the user presses a mouse button is WM_MOUSEACTIVATE notification. The return value of this notification indicates the behaviour of the window after the mouse down, existing 4 options: MA_ACTIVATE, MA_ACTIVATEANDEAT; MA_NOACTIVATE & MA_NOACTIVATEANDEAT. The default is the first one, but I want to change the behaviour of the window to be the the third one: MA_NOACTIVATE, that does not activate the window, and does not discard the mouse message. The function that performs this is DefWindowProc according to the MSDN Help content.
    Any help about doing this in Labview? Is there any special function in Labview that allows setting this behaviour to a window or should I use a Windows dll? In that case how can be programmed? Has anyone done it before? I'm working with Labview 8.6.1, and I haven't found anything about this. Any help will be very useful.
    Thank you very much in advance.
    David Fernández

    It is the front panel window of a VI which I don't want to get focus. I have tried to achive this with property nodes, but the problem I think that cannot be solved in this way, because is the Operative System that gives the focus to the window when pressing a mouse button before Labview does anything. You can release the focus once the window have taken it with the Front Panel window focus property node, but what I really want is to keep the focus on the old window.
    My idea is that the VI act as a background of my application, so never can be over the rest of the windows. Some of them are floating but others are standard and I don't want to use modal windows, so I cannot solve this with the Window Appearance options.
    I have also tried to discard the mouse down in the Mouse Down? event, but I doesn't work, the window continues getting the focus although does not carry on any action.
    Any suggestion?
    Thank you for your interest
    David F

  • 508 accessibility and keyboard focus

    I'm using Captivate 4 and can't seem to get the keyboard accessibility to work properly. I want to be able to control the tab order and keyboard focus on each slide. For example, if the user keeps pressing tab they will eventually move from the .swf file and begin reading the address and menu bar in the browser window. Does anyone know how to ensure that the keyboard focus is provided only to active elements?

    Hi,
    I noticed your post while searching for the same answer with respect to Captivate 5.  So far, it is the closest I've seen to the problem I'm trying to resolve.  I see that you had no luck here, but was wondering if you found a solution elsewhere.  All help would be appreciated.

  • Gainer Focus and Lost Focus

    How implements the methods to gainer focus and lost focus?
    Thanks

    Use a node.focusedProperty() change listener to know when a field gains or loses focus.
    Call node.requestFocus() to ask for focus (for some reason I have to wrap this in Platform.runLater to get it to actually do anything).
    Call node.setFocusTraversable(false) if you don't want the user to be able to tab to the node, but still be able to click on the node to give it focus.
    Call node.setDisable(true) if you don't want the node to be focusable at all.
    I'm not sure how the focus traversable order is calculated, perhaps the order that items are added to the scene?
    Not sure how you would create a custom focus traverse if you needed one.
      @Override public void start(Stage primaryStage) {
        final TextField tf1 = new TextField("First but not initially focused");
        final TextField tf2 = new TextField("Second initially focused");
        Platform.runLater(new Runnable() { public void run() { tf2.requestFocus(); } });
        final TextField tf3 = new TextField("Can focus by clicking on, but not by tabbing to.");
        tf3.setFocusTraversable(false);
        final TextField tf4 = new TextField("Cannot focus at all.");
        tf4.setDisable(true);
        tf1.focusedProperty().addListener(new ChangeListener<Boolean>() {
            public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
              if (newValue) {
                System.out.println("First text field gained focus");
              } else {
                System.out.println("First text field lost focus");
        VBox root = new VBox(); root.setSpacing(5);
        root.getChildren().addAll(tf1, tf2, tf3, tf4);
        primaryStage.setScene(new Scene(root, 300, 100));
        primaryStage.show();
      }

  • Text box should get focus

    Hi,
              In my jsp page I have a form witho two text fields i.e input type="text"
              These two text fields get the values from scanning. Since scanning
              generates an event enter(it is going to submit the form), so after I scan
              the first value to the first text box, the second text box should get focus
              and after the ticket is scanned to the 2nd text box it should submit the
              form and the focus should return to the
              2nd text box and not the first one.
              Thanks
              Madhu
              

    I got it working
              Thanks
              Madhu
              m holur <[email protected]> wrote in message
              news:3c1f42c7$[email protected]..
              > Hi,
              >
              > It needs a java script, I am having onsumbit focus should be on the
              second
              > text box, but it is not working. I need to know what java script I should
              > use?
              >
              > Thanks
              > Madhu
              > Nils Winkler <[email protected]> wrote in message
              > news:[email protected]..
              > > This sounds like you need to use JavaScript...
              > >
              > > Nils
              > >
              > > m holur wrote:
              > > >
              > > > Hi,
              > > >
              > > > In my jsp page I have a form witho two text fields i.e input
              > type="text"
              > > > These two text fields get the values from scanning. Since scanning
              > > > generates an event enter(it is going to submit the form), so after I
              > scan
              > > > the first value to the first text box, the second text box should get
              > focus
              > > > and after the ticket is scanned to the 2nd text box it should submit
              the
              > > > form and the focus should return to the
              > > > 2nd text box and not the first one.
              > > >
              > > > Thanks
              > > > Madhu
              > >
              > > --
              > > ============================
              > > [email protected]
              >
              >
              

Maybe you are looking for

  • No mapping certain records

    hi experts, I have a the scenario file to bapi. I want to do certain records in the file, not verify that the condition does not call the bapi, until now, what I did was to call the bapi but without passing data (I have defined a UFD in the message m

  • Xbindkeys refusing to start after gnome/X update

    I have xbindkeys in my sessions in GNOME, but it won't startup properly from there. After I log in I can start it up normally from the terminal with no problems, but it just won't start up for sessions (and starting it from .xprofile causes my keyboa

  • Export PDF from InDesign Book

    Hi, I have a customer that has huge problems to export PDFs from InDesign Books. He has books with many documents with a total amount of 500-700 pages, when he try to export a PDF InDesign quit unexpectedly. I wrote a script for him that export the P

  • Boot up error - E   err 5! run recover

    Hi everyone, I recently tried running bootcamp on my macbook pro (2013 version) 13". It went smooth until the system rebooted, windows started up and was working fine, however i forgot to plug in my laptop before installation begun ( i was literally

  • After itunes update last week i can not download a new game app,it starts then wipes and says cannot install at this time

    i updated my itunes last week,and now when i buy a new game,it starts to download and then wipes and goes black.and says it can not be installed at this time,please help,,,,,,also whenever i deleate apps to make space on my ipad,the next time i turn