Multiple desktop context menu

All
I have dual screen on OSX when launching the application on one screen and then moving it to another, the context menu's on tables and combox box's the popup menu stays on the screen that the application was launched? Is this a bug? I don't have a windows desktop to test it on.

Here is an example
so on MAC I Launch it on desktop 1, drag it to desktop to and the right click the menu is on desktop 1
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;
public class MenuTest extends Application {
     private TableView table = new TableView();
     @Override
     public void start(Stage stage) throws Exception {
          Scene scene = new Scene(new Group());
        stage.setTitle("Table View Sample");
        stage.setWidth(400);
        stage.setHeight(500);
        final Label label = new Label("Address Book");
        label.setFont(new Font("Arial", 20));
        TableColumn firstNameCol = new TableColumn("First Name");
        TableColumn lastNameCol = new TableColumn("Last Name");
        TableColumn emailCol = new TableColumn("Email");
        table.getColumns().addAll(firstNameCol, lastNameCol, emailCol);
        ContextMenu menu = new ContextMenu();
          MenuItem item = new MenuItem("you can click me");
          item.setOnAction(new EventHandler<ActionEvent>() {
               @Override
               public void handle(ActionEvent event) {
                    System.out.println("you've clicked the menu item");
          menu.getItems().add(item);
          table.setContextMenu(menu);
        final VBox vbox = new VBox();
        vbox.setSpacing(5);
        vbox.getChildren().addAll(label, table);
        vbox.setPadding(new Insets(10, 0, 0, 10));
        ((Group) scene.getRoot()).getChildren().addAll(vbox);
        stage.setScene(scene);
        stage.show();
     public static void main(String args[]) {
          launch(MenuTest.class);
}

Similar Messages

  • What happened to desktop context menu??

    I just upgraded to Mavericks and now my desktop context menu looks like this.
    Any idea?

    I can't see it either. Did you use the camera icon to post it.
    Regardless, here is what it looks like now:
    Here's what it looks like when activated on an icon:

  • Automator will NOT workflows created from Desktop context menu

    1. Right Click on desktop
    2. Select: More > Automator > Create Workflow...
    3. Create a workflow in Automator
    4. Save workflow
    Workflow remains unsaved, no error message is displayed..

    Fixed in OSX update.

  • Terminal as a wallpaper + context menu

    I know about tilda, but what I am looking for, I think it cannot give.
    I want to have terminal that always stays in the background, is transparent, and if I right-click on the background, I can still access the OpenBox or whatever other desktop context menu I am using.
    Is this even possible?
    Last edited by Lockheed (2012-02-26 22:17:50)

    First: Well, when I said, it can't be edited, I meant that it can't be configured in terms of theming, behaviour etc...you can of course edit the entries (or have them created by menumaker).
    Sry, my fault, I gotta be more precise
    compiz-boxmenu really is simply a script to show the popup-menu with entries, nothing else. If you want to use it, you can create a shortcut, use the command in a terminal or a kicker or whatever way you prefer to launch an application (it's even DE/WM-independent and you could use it in KDE or Openbox or else, too)
    Second: Why can't you paste anything into it, when it's transparent? oO
    It's still the same terminal...I use it the same way, and, for example, pasting per middle mouse button works fine.
    Anyway, you can of course have to tildas, just make sure, you start each tilda with it's special config file (something like tilda -c /path/to/file AFAIR)
    Third: How did you start the compiz config settings manager? By a menu? Or simply by "ccsm" per terminal? Or did you start something completely different that you mistook for the ccsm?^^
    In that case, you could still edit config files by editor and I would check the correct entry on my files.
    Fourth: You can't set application specific mousebindings in compiz
    EDIT: If you want to have a second tilda, you're better off giving them new names, like "desktoptilda" and "dropdowntilda" or sth like that, so you can set "desktoptilda" to "below", otherwise both will be set below and the one you actually want to use mightend up hidden below the other one.
    Last edited by desm0tes (2012-02-25 15:07:00)

  • Bug: Context menu operations on multiple selection of uix-nodes do not work

    Hi,
    when i select multiple .uix files in the navigator and then chose "Check XML Syntax", "Validate" or "Auto Indent XML" from the context menu, the selected operation is only done for the first file in the selection.
    This is a nice Bug because this works for Make and Rebuild context menuitems, even if those items display the filename even for multiple selection ("Make AFile.uix).
    Would be nice if those operations would work on the "HTML Sources" node or a subfolder.
    Regards, Markus

    thanks. we'll try to fix this in an upcoming release.

  • Multiple entries in context menu

    Hi,
    when right click on a file to open with a programm, the context menu shows multiple entries for some apps. My question is now how to put away multiple entries?
    Best regards,
    Thomas

    If you are speaking of the "open with" list having multiple application entries, if could be caused by a couple of things.
    1) The entries could not actually be "duplicates", but essentiially are to you, as you only want one. If you have or have had more than one version of an application, the menu will list all versions of that app that are/were ever detected.
    2) The list could be populated with duplicates that the system detected when either networking with another Mac, or accessing a cloned drive of your system. If this is the case, you need to rebuild the database that is serving up these duplicates.
    Resetting the 'Open With' Menu
    Resetting the 'Open With' menu will remove duplicates and ghost applications (ones you have deleted) from the list. You reset the 'Open With' menu by rebuilding the Launch Services database your Mac maintains. There are multiple ways to rebuild the Launch Services database, including third-party system utilities like Cocktail and Onxy.
    If you don't own a system utility that can rebuild the Launch Services database, don't worry; you can perform the rebuild yourself using Terminal.
    Using Terminal to Rebuild the Launch Services Database
    Launch Terminal, located at /Applications/ Utilities/.
    For OS X 10.5.x and later, enter the following at the Terminal prompt, and press enter:
    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram ework/Support/lsregister -kill -r -domain local -domain system -domain user

  • Right-click context menu in desktop appearing slow win 8.1

    Hi,
    I have just upgraded from windows 8 to win 8.1 everything is fine except the context menu I don't know why it is so delaying. Every time I do right click on desktop to refresh it takes almost 15 seconds to appear.
    Help me guys.
    Many thanks.
    Umair.

    Hi,
    In my opinion, this problem caused by two reasons. One is 3<sup>rd</sup> shell extension reason, the other is system performance. You can follow the steps below to fix this problem.
    First of all, click the link below to download ShellExView:
    http://www.nirsoft.net/utils/shexview.html
    1. This program does not require installation, just right click and run as Administrator
    2. From the menu, click on Options then click on Filter by Extension Type and select Context Menu
    3. On the list, you'll see some of the entries with pink background, those are installed by the third party software
    4. Hold down CTRL Key and select all of them then click on the red button on top left corner to disable.
    5. Click on the Options again and select Restart Explorer
    6. Now try to right click on desktop to see if it fix your problem. If it does then start to enable one by one
    and repeat step 5 until the problem occurs again, that's the offending extension.
    In addition, does this problem occurs after system startup? If so, I would like to suggest you to perform a Clean Boot to check whether this problem caused by 3rd program or service. Refer to the link below for more details.
    http://support.microsoft.com/kb/929135
    If you need further assistance on this particular issue or any other Windows related issue, let us know and we will be glad to assist you.
    Roger Lu
    TechNet Community Support

  • Multiple "Open URL" items in terminal right-clicik context menu

    Since http://discussions.apple.com/thread.jspa?threadID=2068339 was closed without anyone apparently even bothering to reply to it, I'm reviving it here - unlike the previous asker, I'm rather more resilient and determined.
    The terminal right-click context menu has 3 - 4 "Open URL" items on it, even on terminal tabs where there is no URL anywhere. Can someone please tell me how to fix this?
    Thank you.

    Thank you very much Linc. After allowing the command to run and restarting the terminal, that seems to have had the desired effect. +2 for you!

  • How to remove multiple Unarchivers from Context menu

    Hi,
    I am running Mountain Lion on a late 2011 MBP. Every time I upgrade Unarchiver, it creates a new line item in the context menu. How can I get rid of all but the latest one and how can I prevent this from happening? This seems to be a problem with Unarchiver only, the other Apps don't have this issue. Screenshot attached for reference.
    Thanks in advance for your time.
    Abhijit

    That's LaunchServices. These are only cache files but can get corrupted. Launch /Utilities/Terminal and copy & paste this at the command line to rebuild LaunchServices: (be sure to copy the entire line it's a scroll)
    Code:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. Let us know.
    Or, use the free utiltiy OnyX to do the same via gui
    EDIT: Actually the issue may be with the way unarchiver code is written and LauchServices is doing it's job correctly. But it can't hurt to see.

  • Context menu oddity: 2 "QuickTime Player" items on OSX context menu?

    Hi,
    This pertains to QuickTime Pro 7.0.4. I never noticed this before I upgraded to QuickTime Pro 7--when I right-click on a file that can be opened in QuickTime, I see two QuickTime Player items on the context menu. Either one opens the movie.
    More specifically--when QuickTime is specified as the default application for a file, QuickTime Player appears at the top of the context menu as well as in the list of other applications that can open the file. When QuickTime is not the default application, two QuickTime Player items appear in the list of other application that can open the file when right-clicked.
    I looked through the Contextual Menu Items folders, but couldn't find any duplicate files. This affects both my G5 desktop system and my PB G4; both are runnning the latest version of Tiger (10.4.6) as well as the latest version of DivX. On my G5, I have Final Cut Studio installed; but not on the PB.
    Anyone else experience this oddity? Any idea how to get rid of the duplicate item on the context menu?
    TIA
    M

    The contextual menu "Open With..." command uses data from the Launch Services app (part of the system software).
    Having duplicates in the menu is a very old issue and there are dozens of reasons why multiple apps show up. It could be reading a "backed up" duplicate app or multiple copies (I have 4 versions of the QuickTime Player app installed) of the software.
    Cleaning out the Launch Service list can be done with some third party software (I don't know the names) or with some Terminal commands (don't know them, either).
    Maybe a Google search or a search at http://www.versiontracker.com/macosx can help you out.

  • Explorer context menu

    In Windows Explorer, when I right click a file, I can open the VI by selecting an application from the "Open With..." item. However, whenever I run Labview 8.2, it removes my Labview 8.0 item from the list, making it cumbersome to start up an older project. (I have to start Labview 8.0 with a desktop icon and then open the VI).
    What I would like to see is for each version to add its own item to the menu bar, but still leave the old ones there. That way when I want to open an older project, I can simply right-click and pick the appropriate version.
    Alternatively you could have a handler that determines the version from the VI and starts the correct version of Labview.
    Brian Rose

    All that context menu stuff is handled by the registry. The explorer application simply gets its information from there. So Labview can write to a registry key to add itself to handle a file type. This is why you can have multiple applications handle the same type and show up in the context menu.
    My point is that after I run LV 8.0, I will see both LV 8.2 and LV8.0 in the context menu (along with a couple of others). However, after I run LV 8.2, the LV8.0 option is removed. I'm guessing that this is related to a program's behavior in checking and setting the registry key to make sure that it is the default handler for the appropriate file types. NI would need to strengthen this code to be sensitive to previous versions of Labview.
    A rough example of how to do this is at  http://www.codeproject.com/w2k/extendingshell.asp
    Brian Rose

  • Multiple Desktops

    Really like the multiple Desktops.  @ 1st thought it was much like Alt-Tab or hovering across Taskbar, basically, another View/Select approach.  In 7 (& 8) would run more than one tabbed browser grouping related sites in each.  This
    does that and on a higher level.  Can EASILY be done by 'family' or even if different sign-ins are required.  Can be put to good use, keeping things nicely organized & the Desktop, et al, neat, clean & uncluttered.
     Just wanted to reiterate what a cool feature I find this to be of Windows 10. IT is so nice how related things can be grouped together making the experience slick, neat, tidy & very organised & uncluttered... not having a bunch of stuff all mixed
    up together on one Desktop.  Microsoft calls it "Virtual Desktops".  For example, I have one w/ Skype, Outlook, Calendar... another w/ all IT stuff.... another w/ Home page & whatever & another w/ sites devoted to a singer/song-write
    of particular interest to me. Anyway, you get the idea and certainly can be configured however YOU fancy.  You simply open one, put what you want in it, hit the + sign & open another, fill it and so on.  I am not sure, yet, as to how many
    one can have but, a few, @ any rate.
    10 sure is easy to use.  Makes such a nice difference not having 'Hot Corners', hidden things or stuff that pops out from edges.  Plus, now, w/ 10 and its menu, I don't have to enable the Desktop Toolbar or create a folder on the Taskbar for Applications
    and can, still, not have to change screens for anything; just be 100% on the good ole Desktop.  All w/ hardly any 'learning curve'!  And it sure is speedy!  Certainly, non-touch PC Users should not have complaints w/ Windows 10.
    Cheers,
    Drew
    Drew MS Partner / MS Beta Tester / Pres. Computer Issues Pres. Computer Issues www.drewsci.com

    Thanks for your response. I think we might be talking about the same Desktop... If you close all your folders and applications and just have the Finder - I'm talking about that Desktop. The one that's called "Desktop" in Places. The one that in System Preferences is called "Desktop and Screensaver" and lets you place a picture of your choosing in the background. I think that's what you mean when you say it's "the background that all your windows and folder sit on." That's the Desktop I mean. (It is called the Desktop, isn't it?) The point isn't having different pictures there - that was hypothetical. At the moment I have a few folders and quicktime files sitting on my Desktop. If I create multiple Spaces - no matter which Space I open, the exact same folders and quicktimes remain on the Desktop. What I was wondering - and suspect isn't possible to do - is being able to create multiple Desktops: one that will have nothing but quicktime files waiting to be opened, one that will have nothing but folders waiting to be opened, etc. I hope this is clearer.
    Message was edited by: truffaldin

  • Yosemite consolidating multiple desktops on dual monitors,

    I have a Mac mini (mid 2010) - 2.4 GHz - 350 GB - Yosemite 10.10.2 - with dual LG monitors. Instead of using Mission Control I prefer to have multiple desktops on each monitor. I dedicate a single app to each desktop, e.g., Safari, iTunes & iPhoto on Mon1 facing Mail, Messages & Calendar on Mon2, and swipe between apps, which I find more convenient. Six numbered desktops plus Dashboard.
    In Mavericks this arrangement was preserved on restart. However, in Yosemite, all apps on Mon2 are consolidated in a single desktop, the remaining 2 desktops - 4 & 5 - have migrated blank to Mon1, PLUS an additional blank desktop - 6 - is generated on Mon1. The single desktop on Mon2 is now 7. On subsequent restarts there become eight, then nine, then ten desktops, etc.
    I've been up and down the settings options, tried System Help, outside searches, and even mentioned the issue in passing during an unrelated Apple Tech Support call. To no avail. I had hoped that one of the updates would resolve this. It is easily but inconveniently resolved manually, but as I mentioned this was a non issue in Mavericks.
    I mentioned this problem in an earlier post, but in less detail. Has anyone else experienced or heard of this?

    I did find a workaround........ that works so far....... If I put FCPX into full screen mode.  Then my events dissapear!!!!  But if I toggle on and off the "Window/Show Events in a separate window" menu then the Events reappear and I can swipe between desktops and all the windows behave as they should.  That's a relief.  The old method doesn't work but at least this one does.  I hope this helps someone who is swiping like a mad man like I was.

  • Are multiple desktops in 'Lion' totally pointless?

    Having multiple desktops for different activities or jobs seems pointless if you can't open a software application from the toolbar when it is already in use on another desktop. i.e. If I need my addressbook open on my personal desktop and also on my work desktop, I can't do it. If I try the desktops flip across screen 'wham! to the desktop where the application was originally opened! No good. The only thing that comes close is to open a new 'file' on the "main" desktop and move that individual file to another desktop whilst in the Mission Control position. That says it all! It's daft... and if you close it down you cant open it again without redoing the whole mission control thing. Am I missing something here apart from my patience?

    They way that I perfer to work, there are no cases where I want the OS to switch to another desktop simply because I choose to open an application that happens to already be opened on another desktop.  For me, I want the application to open in the current desktop, regardless if it is already open in another desktop.  I tend to have multiple applications open on a single desktop in windowed mode - where no single application consumes the entire screen.  For me, out-of-sight-out-of mind applies - I need to be able to see what I have to work with.
    However, some of my friends at work prefer to work in a full-screen mode, where a singe application takes up the entire screen.  They are constantly switching back and forth from one application to the other, typically by pressing CMD+TAB.  I guess in this context, having the OS switch from one desktop to another based on where the application is opened would make sense.  But, to me that seems like a big waste of a desktop - only showing one application.
    So, here is an example of my use-case.  I come to work and powerup my Mac.  I open  Finder and Excel so that I can start working on a report.  While I'm working on the report a friend comes over and asks me to help him with his report.  In this case, I would prefer to switch to an unused desktop and then proceed to open the applications that I need for this new task, such as  Finder and Excel (the same ones I was using for my report but now I need for my friend's report).  I already have context in those applications on Desktop1 and I don't want to lose that, hence my desire to use another desktop. So, I go to Desktop2 and click on the Finder icon in the Dock.  Instead of it opening a new instance of Finder on Desktop2, I'm jolted over to Desktop1 where Finder was already opened.  But I don't want that - I want to keep my place in Finder on Desktop1 and open a new one on Desktop2.  Sure, I can hold the CTRL key down while I press on the Finder icon in the Dock and tell it to open a new window.  However, instead of it opening a new window in Desktop2, it opens it in Desktop1 while leaving me in Desktop2 and wondering where the new Finder window is.  It seems that Safari works correctly in that it will open a new Safari window in Desktop2 if I hold the CTRL key down while I click on its icon in Dock.  However, if I forget that, I'm transported over to Desktop1 - which I don't want.
    How Firefox is handled is just weird.  Lets say that I am in Desktop1 and I have Firefox opened.  Then I switch to Desktop2 and now I want Firefox open in Desktop2 too.  While in Desktop2  I can  hold the CTRL key when clicking on its icon in Dock and tell it to open a new window.  Indeed, it will open a new window - but not in Desktop2.  Instead, it opens a new window in Desktop1 and I get tranported over to Desktop1.  Again, not what I want.
    Sure, you can blame the applications for this.  But to me, the OS is the coordinator of all the resource on the system, including the applications.  So, in my opinion, if it does not work consistently and and if it does not work how I expect  then it does not work well.
    -Rod

  • [TUTORIAL] Context Menu to export EML files

    Hello there folks!
    I'm pretty new to the topic of C3PO, GW and all the Novell stuff and one of my tasks was to "code an export mechanism for GW8 thats lats us save e-mails to our storage system". Ok, that was a hammer. But wrapping my head around it and starting to error out the things got me pretty far and I guessed it was tutorial material. So here we go:
    @Moderators: This is the thread that has everything in it. the other one can be deleted.
    This tutorial is intendend for C# only. I don't like VB and I'm too dumb for C++ so if you need it for another dialect you need to work it out your self.
    Agenda:
    Needed packages
    C3PO wizard
    Loading to Visual Studio 2010
    Needed Imports/References
    Simple MessageBoxing
    Export Code
    Registering and caching the .DLL
    Testing (please help me with a better way here)
    1. Needed packages
    the novell-gwc3po-devel-2012.11.15.zip file (unzip this after downloading)
    an installed version of Visual Studio 2012 C# (or if you want to work with a different dialect choose another)
    cmd access to some of the registering tools:
    It may be the best thing to set tose paths up in you env variables. Allthough when running the cmd with administrator privileges you can't use regasm from env variables and need to cd to the directory.
    RegAsm (regasm.exe): C:\Windows\Microsoft.NET\Framework\v4.0.30319 (the version depends on the target)
    GACUtil (gacutil.exe): C:\Program Files(x86)\Micrsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\ (this path is also dependent on your target framework version, I chose .NET4)
    StrongName (sn.exe): C:\Program Files(x86)\Micrsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\ (this path is also dependent on your target framework version, I chose .NET4)
    a good beverage :D (you should obtain multiple of these :D)
    2. The C3PO wizard
    In my case I wanted to add the functionality via the context menu. So the code executes when right-clicking on one or multiple messages displays another menu item and is clickable.
    This is pretty easy to realize via the C3PO wizard. You'll find it in the downloaded and extracted novell-gwc3po-devel-2012.11.15.zip from above. Start it (it is located in extracted-zip-folder/gwc3po-FILES/C3POWizard/C3POWizard.exe) and setup your project:
    Setup the project in the wizard step 1
    I usually setup the Wizard inside my Visual Studio 2010 projects folder, create a new folder there with the name of the project and check the options i want to have.
    In the next step I chose which type of View should display my custom context menu. Since I was only interested in exporting and working with e-mails I chose "GW.MESSAGE.MAIL" and added it to the bottom list via, you guessed it, "Add".
    Setup theView that invokes the new context menu item
    In the next step you I had to setup a new entry for the context menu. You could make side-droppable menus here etc. But for me a simple "Add Menu" was enough. Give it a name of your choice (beware: I'm yet to find out where to change this setting in the source files).
    Creating a Menu Item in step 3
    Click through next and the wizard will sum up you choices. In the next dialog window you will be prompted to specify the language you want the code to be generated. I chose .NET C#.
    In the prompt after that you will be asked if the wizard should create a .DLL-project. You click yes.
    Quit the wizard with the "Done" button.
    3. Loading to Visual Studio 2010
    Open up your Visual Studio and go to File -> Open Project. Navigate to the folder where you just created the files with the C3PO-Wizard. and open up the .csproj file.
    All the files get loaded and it seems quite well. but now it's time for some other stuff: Signing, or better, providing a key for signing.
    Allthough the README.txt (also in your project folder) states this is not neccessarily needed I did not get it to work without a key file.
    Open up a terminal and tpye in sn /? to see if the environment variables work. If not you can yuse the abolute path to sn (see: 1: Needed packages). If everything works as expected you can generate your keyfile with sn -k <PathToYourProject>\Archive.snk.
    In Visual Studio, go to Project -> <ProjectName>-Properties -> Signing -> Sign assembly [x] -> Search and pick the .snk-file you just created.
    Good. A first compilation of the project with F6 should rumble through without problems. Go to <ProjectFolder>\bin\Release and copy the .dll files to <GroupWiseInstallPath>.
    After that you need to open a cmd windows as administrator and cd to the RegAsm.exe directory and execute the following: [I]regasm "<GroupWiseInstallPath>\<TheDllName>.dll". Then execute gacutil -i "<GroupWiseInstallPath>\<TheDllName>.dll".
    RegAsm will register the extension to the Windows registry and GACUtil will cache the .dll content to make it available to GroupWise.
    You need to re-cache the .dll everytime you compile in VS. So basically the workflow is Compile -> Copy dll to GroupWise directory -> re-cache with gacutil -i -> Start Groupwise
    I have not found a method to post-build execute a script that does that. Problem is the copying and the gacutil caching (both must be done as administrator).
    IIf everything worked you see a new entry in the context menu when right-clicking a mail in Groupwise. When you click it, there will appear a message box.
    The MessageBox is defined in GWCommand.cs L. ~125
    4. Needed Imports/References
    Since we got the skeleton to compile and function properly, it's time to get our own code in there. FOr rapid prototyping I do all the stuff in GWCommand.cs.
    Go to Project -> add Reference -> COM and select "C3POTypeLibrary", "GroupWareTypeLibrary, "GroupWiseCommander", "GroupWiseConnectorLibrary" and click OK. The selected entries now appear in the project explorer.
    5. Simple MessageBoxing
    A thing I like to do (because I'm not a very good programmer) is to get all sorts of infos to get displayed with
    Code:
    MessageBox.Show();
    Just fling it in the code and see what get's where etc. An important thing is allready in the comments of the file.
    It is this line:
    Code:
    C3POTypeLibrary.IGWClientState6 myCL = (C3POTypeLibrary.IGWClientState6)WIASSArchivButton.g_C3POManager.ClientState;
    . Uncomment it and play around with the myCL-object in your code.
    The myCL has some properties we will use later on such as myCL.SelectedMessages which is exactly what we need for our archive functionality.
    6. Export Code
    Now we get to the code:
    With the
    Code:
    ClientState
    dug up in the code we can pass the
    Code:
    SelectedMessages
    into a
    Code:
    MessageList
    . Over this MessageList we will iterate and save each
    Code:
    Message
    with the so called
    Code:
    GroupWiseCommander
    to our disk. well that sounds simple. And, well after digging through a lot of threads here on the forum and the documentation, it is.
    Here is the Execute() method from GWCommand.cs:
    It has comments that should serve as a documentation.
    Code:
    public void Execute()
    try
    switch (m_PersistentID)
    case WIASSArchivButton.vWIASS:
    //C3PO WIZARD Put execute command code here for WIASS Context menu.
    /* this was in the comments and is essential!
    * the myCL object provides us everything we need to interact with the messages */
    C3POTypeLibrary.IGWClientState6 myCL = (C3POTypeLibrary.IGWClientState6)WIASSArchivButton.g_C3POManager.ClientState;
    // get the selected messages
    object o = myCL.SelectedMessages;
    // and convert the SelectedMessages to a MessagesList
    MessageList ml = (MessageList)o;
    // iterate over all the selected Messages
    // this was tricky: the index of the MessageList starts by 1 and not at 0
    for (int i = 1; i <= ml.Count; i++)
    // the .Item() method expects either a string or a long
    // see http://www.novell.com/documentation/developer/groupwise_sdk/gwsdk_gwobjapi/data/h20s5bdo.html
    long index = (long)i;
    // instantiate a Message object to get access to the different properties like subject, sender etc
    GroupwareTypeLibrary.Message oMessage = (GroupwareTypeLibrary.Message)ml.Item(index);
    // instantiate a GroupWiseCommander
    // this is the interface to the TOKEN API
    // TOKENS: https://www.novell.com/developer/documentation/gwtoken/index.html
    GroupWiseCommander.GWCommander cmdr = new GroupWiseCommander.GWCommander();
    // the GWCommander has an Execute() method that is able to take certain tokens kind of like SQL
    // lets build the token (the complete list is huge and awesome) to save our Messages
    // ItemSaveMessage(): https://www.novell.com/developer/documentation/gwtoken/gwtokens/data/hbt0bd7x.html
    string tokenCommand = "ItemSaveMessage(\"" + oMessage.MessageID + "\"; \"C:\\archiv\\" + oMessage.MessageID + ".eml\"; 900)";
    /* what happens here ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ is that we build us a TOKEN command that the
    * GWCommander is able to execute.
    * the actual command is ItemSaveMassge()
    * everything between the semi-colons are the parameters:
    * \"" + oMessage.MessageID + "\" : builds an ANSISTRING of the MessageID which we get from the oMessage onject
    * \"C:\\archiv\\" + oMessage.MessageID + ".eml\" : build an ANSISTRING of the output filename
    * 900 is the type we want to export. 900 stands for Mime
    * CAUTION:In this example I use C:\archive\ as the destination folder. It must exist and be writable to the program
    // now that we have setup our command we can get it executed by the commander
    // the result is sort of a callback variable
    string result ="";
    cmdr.Execute(tokenCommand, out result);
    /* here can the error handling be done with the result string
    break;
    default:
    MessageBox.Show("Unsupported Case", "Error", MessageBoxButtons.OK);
    break;
    //A way to get the GroupWise client state with newest interface
    //C3POTypeLibrary.IGWClientState6 myCL = (C3POTypeLibrary.IGWClientState6)WIASSArchivButton.g_C3POManager.ClientState;
    //uncomment the code below to unblock the base command
    //IGWCommand baseCmd = (IGWCommand)WIASSArchivButton.g_C3POManager.CreateGWCommand(m_objBaseCmd);
    //baseCmd.Execute();
    catch (Exception e)
    MessageBox.Show("Error Executing GWCommand: " + m_PersistentID.ToString() + " Error: " + e.Message);
    return;
    7. Registering and caching the .DLL
    After that you need to open a cmd windows as administrator and cd to the RegAsm.exe directory and execute the following: regasm "<GroupWiseInstallPath>\<TheDllName>.dll". Then execute gacutil -i "<GroupWiseInstallPath>\<TheDllName>.dll".
    RegAsm will register the extension to the Windows registry and GACUtil will cache the .dll content to make it available to GroupWise.
    You need to re-cache the .dll everytime you compile in VS. So basically the workflow is Compile -> Copy dll to GroupWise directory -> re-cache with gacutil -i -> Start Groupwise
    8. Testing (please help me with a better way here)
    Is there a good way to hook every thing up together to jsut stay in VS , compile, files get copied, registered, cached and GW starts?
    Thanks for reading!
    I wrote this up to have a documentation for myself and others. please let em know if you need help or anything is missing or not clear. It's certainly not a total noob guide and I expect a bit of knowledge to be honest.
    Regards
    Sebastian

    Originally Posted by Username951
    Multiple email selection should be possible, but only those emails that are fitting some requirements should be stored finally in database.
    One requirement is for example that a keyword like "ISSUE" appears in the email subject
    (followed by a ":", a "space" and some characters that can be converted to an integer value),
    multiple, leading "Fwd: " and/or "Re: " should be handled well,
    subject should be handled case-in-sensitive.
    This sounds like you should implement some sort of SelectedMessagesValidator class just to keep it clean.
    Originally Posted by Username951
    So here are my find outs, remarks, etc.:
    1.) Visual Studio should be started under admin. rights.
    Then you can write a post-build event (batch) that copies, "regasm"s and "gacutil"s everything.
    As said this works fine for me.
    But note that unfortunately the paths to "regasm" and "gacutil" changed
    (compared to the time where you wrote your tutorial).
    Definitely. That way, as you mentioned, the post build scripts integrate very well.
    Originally Posted by Username951
    2.) The "Novell C3PO" wizard was downloaded and worked out as described in our tutorial.
    One important step was to use "GW.MESSAGE.MAIL" and not "...BROWSER..." or something else.
    I can not figure out, where you have the GW.BROWSER thing from, but in my examples I allways used GW.MESSAGES.MAIL
    Originally Posted by Username951
    The wizard created finally the basic C# (.NET framework 2.0) project.
    This project was loaded in Visual Studio 2013, automatically converted to "newest version"
    and finally was a ".sln" made.
    Yes. You can leave it at 2.0. I just have the 4.5 installed so i will target this version
    Originally Posted by Username951
    "oracle.dataaccess"
    -> Note that the "Copy Local" property must be set to "true"!
    (This property will be reset to "false" after a successful (re)build.
    So check this and change it to "true" for the first build!
    This must be made only once because after a successful build is this .dll known;
    keywords: GAC -> cached
    But note that "successful" means also that the post-build event ran flawless!)
    This is quite specific to your case since my example on exports a flat EML file to the hard drive
    Originally Posted by Username951
    2.) regasm.exe needs strong names.
    So a "cmd" with admin. right was opened,
    a
    "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\sn.exe" -k "C:\Users\<username>\Documents\Visual Studio 2013\Projects\GWSaveToDatabase\GWSaveToDatabase.sn k"
    fired
    and the created "GWSaveToDatabase.snk" file added to the solution.
    I don't want to be picky, but it's gacutil that needs the strong names. ragasm is not complaining
    Originally Posted by Username951
    (Development) Remarks
    1.) While I used the "C3PO" wizard first time I used "Add Menu" item - as you said in your tutorial! :-(
    And that is definitely wrong!
    See:
    The result was a C# project that does not show any new context menu entry.
    So I tried at the next wizard run "Add Menu Item".
    The wizard created again a C# project but still no new context menu entry in the GroupWise client.
    (And that after all needed steps
    like
    copy to GroupWise installation path,
    regasm and gacutil over all .dlls
    etc.
    were successful be made).
    It took a complete day to get the idea to "merge" the two wizard created projects!
    Why merging?
    Because the second project contained a "const" which were used in the switch statement of the "Execute()" method
    (with the same meaning like your "WIASSArchivButton.vWIASS" - see your code snippet above!)
    and the "CustomizeContextMenu(...)" method in "CommandFactory.cs" looked also different
    while the first project does not contained something similar.
    ( For example:
    The "CustomizeContextMenu(...)" method had more statements.
    And that made more sense to me compared to the first wizeard created C# project.
    Since I uploaded a better example this is obsolete.
    Originally Posted by Username951
    So I ASSUME that the second project would work but it does not because of regasm / gacutil behaviour.
    Means I believe it would work when all
    with regasm registered
    and
    with gacutil to the cache added "things"
    would be "un-registerd" and "un-cached".
    This is, as I assume, due to the Interop.C3POTypeLibrary.dll. This must me cached every time the project is build. maybe you could use gacutil -i Interop.C3POTypeLibrary.dll -f to force the recaching
    Originally Posted by Username951
    So, finally I took the second, wizard created C# project and copied the "const", adjusted the "Execute()"
    and "CustomizeContextMenu(...)" methods, etc.
    After that the context menu were shown in the GroupWise client!
    Thats is correct. But I never had to do this. The thing is, that the "Add Menu Item" is giving you the opputunity to specify a command, which the "Add Menu" doesn't.
    Originally Posted by Username951
    2.) The next issue was that the context menu was added as often as many emails were selected.
    Means: For example: Three selected emails ends up in three time added context menu.
    Solution:
    Checking
    var existsAlready = menuItems.Item("...");
    if (existsAlready != null)
    return;
    in "CustomizeContextMenu(...)" method and leaving the method under shown circumstances.
    I added a fix for this in the second post, but it isn't working in GW2012 anymore. I have a very ubly fix for that in my new code.
    Originally Posted by Username951
    3.) The by the wizard created registry path contained the version number "5.0".
    This may confuse but it is finally ok. No need to change here anything!
    On the other side:
    It will NOT work when the registry entry
    "SOFTWARE\\Novell\\GroupWise\\5.0\\C3PO\\DataTypes \\...."
    will be changed/"adjusted to that GroupWise client version you are currently using"!
    This is all part of the official documentation and wasn't touched by Novell since quite a long time.
    I think i will make a github repository in the futer as a proof of concept and kind of a accessable documentation for everyone.

Maybe you are looking for

  • Colour shift in save for web when saving on PC and then viewing on Mac

    Hey peeps, I am aware of this colour shift when saving images for web.  I have a designer resizing, cropping photos, and then saving on PC. He uses PC and when he sends the photos over to me on my Mac there is a big colour shift (photos are much ligh

  • Multiple rows in a single row.

    I want to know how can I store the values of multiple rowe in a single row.for an example.. machine name    manchine no  frequency   month Lathe                  MOO1          yearly         jan Lathe                  MOO1          halfyearly   feb L

  • Creating a PDF

    I have posted this before but because I was away my reply to a responce was not answered so here goes again: I have Adobe Acrobat 8 Pro v 8.13(as part of CS3) and MS Word 2007 (as part of Office 2007)and have been trying to create a PDF file from a w

  • Standby log files in Oracle Dataguard

    Hi, What is the difference between standby log files and online redo log files in a Dataguard environment? What is the use of standby log files? Thanks, Charith.

  • I am getting runtime error as load_program_not_ found

    i am getting a runtime error as load_program_not_found......... what might be the problem and how to solve it???