[JNI] get the window ID

Hi,
I'd like to get the window ID of a frame. I'm runing java on Linux.
I've seen on a web site that I can get it from the JAWT_X11DrawingSurfaceInfo.
So I did this to get the JAWT_X11DrawingSurfaceInfo :
JNIEXPORT jlong JNICALL Java_MyFrame_getWindowID(JNIEnv *env, jclass cls, jobject comp) {
  JAWT awt;
  JAWT_DrawingSurface *ds;
  JAWT_DrawingSurfaceInfo *dsi;
  JAWT_X11DrawingSurfaceInfo *dsi_X11;
  jint lock;
  jlong windowID;
  jboolean result;
  /* get the awt */
  awt.version = JAWT_VERSION_1_3;
  result = JAWT_GetAWT(env, &awt);
  assert(result != JNI_FALSE);
  /* get the drawing surface */
  ds = awt.GetDrawingSurface(env, comp);
  assert(ds != NULL);
  /* lock the drawing surface */
  lock = ds->Lock(ds);
  assert((lock & JAWT_LOCK_ERROR) == 0);
  /* get the drawing surface info */
  dsi = ds->GetDrawingSurfaceInfo(ds);
  /* get the X11 drawing surface info */
  dsi_X11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
  windowID = (jlong)dsi_X11->visualID;
  /* resource cleanup */
  ds->FreeDrawingSurfaceInfo(dsi);
  ds->Unlock(ds);
  awt.FreeDrawingSurface(ds);
  return windowID;
}My pb is that I can't lock my frame. It always crash here : assert((lock & JAWT_LOCK_ERROR) == 0);
I'm completly lost at the moment, any help will be welcome.
Thank you for your answers.
Nicolas

Linux_Java wrote:
How do i get the Window Id / handle to java frame.You can't get it from within Java, that much I know, and in fact since it is an OS construct it is meaningless in java. If you are working with MS Windows, I'm guessing that your best bet is to play with some of the functions in the User32 library, such as enumerateWindows and such, and by doing this you'll find out how to get a handle on the JFrame. If it's unix/linux (and given your name, that is a reasonable assumption) then I have no idea.
If I am giving any actionlistener to my frame that has to be reflected in C windowNo idea what you mean here.
Anybody can send me the full source code too.Doesn't this kind of go against the philosophy of these forums?
Also, consider posting this sort of question in the JNI forum where you will have a much better chance of getting a JNI guru who actually knows what he's talking about instead of, well, me.

Similar Messages

  • I am trying to install windows 7 on my macbook pro 13", when i run bootcamp it tells me that there is not a windows support software available for my computer. Where can i get the windows support software for my macbook?

    I am trying to install windows 7 on my macbook pro 13", when i run bootcamp it tells me that there is not a windows support software available for my computer. Where can i get the windows support software for my macbook?

    Apple only supports Windows on certain hardware.
    http://www.apple.com/support/bootcamp/
    Apple provides their framework for Windows to run on a Mac, a piece of software called a Hybrid MBR that bridges the gap between how Windows reads the drive partition table (MBR) and EFI/GUID partition table that Mac's use.
    It doesn't mean Windows can't run on your Mac, a third party solution called rEFIt will also bridge the gap and allow booting of more that just Windows, Linux as well for a triple booting computer.
    Your hardware has to meet the other requirements the second and third operating system needs as as being able to install drivers that will work for your hardware, especially the fans or they will run loud and fast by default.
    http://refit.sourceforge.net/
    This above is a advanced procedure which requires knowledge how computers and various operating systems, drive formats and so forth work.
    I even admit I don't know everything myself, but I experiment on a separate piece of Mac hardware (out of warranty/AppleCare) designed for this purpose so in case something screws up I'm not taking down my only machine and can use the other to get online and find solutions.
    There is a very high potential for losing your data if your using advanced/non-Apple methods to install Windows on your only Mac where Apple doesn't support it. Also one shouldn't be doing this on Mac hardware that is under AppleCare or warranty as it might be voided. Proceed at your own risk and education.

  • Hi. Downloads has changed; I cannot open or download attachments. I don't get the window that asked "Open" or "Save" either.

    When I receive an attached document (Word or OpenOffice), I click on it. I get a Norton Antivirus window that says it's clear and I click on the yellow Download button. Then nothing happens. 1. I don't get the windows that asked Open? or Save?. 2. The documents are not in the Download folder. 3. I reset the downloads to my Documents folder - nothing appears there either. 4. I search my iMac with the file names, and no results show up.

    Hi carrieinholland-
    I would recommend reading this Support article on troubleshooting Opening/Download issues:
    [[Managing file types]]
    Hope that helps.

  • I recently transfered everything from my emac to another one but now when I try to open iTunes I get the window that states: The file "iTunes Library" cannot be read because it was created by a newer version of iTunes.

    I recently transfered everything from my emac to another one but now when I try to open iTunes I get the window that states: The file "iTunes Library" cannot be read because it was created by a newer version of iTunes. The computer I transfered to had a bunch of files on it and I got full ownership of what was already there, so, how do I get to my iTunes library, I do have access as an administrator to the iTunes library (that works just fine) already there and I guess I must have had a newer version ofiTunes on my defunt eMac....

    Tell us some version numbers please, of your Mac OS versions and iTunes versions on both computers (two eMacs yes?).
    dlrobinson49 wrote:
    I guess I must have had a newer version ofiTunes on my defunt eMac....
    That is a pretty good guess.Try updating the second eMac's iTunes to at least the version that was on the first.

  • I bought the Mac version of Premiere Elements, can I get the Windows version for free or cheap with my serial number?

    I bought the Mac version of Premiere Elements, can I get the Windows version for free or cheap with my serial number? I'm about to migrate back to PC soon and I'd love to not have to buy the program again since I just bought it. Under my order history though it only shows it for Mac so I wanted to make sure.

    ihavea4
    The boxed packaging is not sold by Adobe direct. If you want to explore that type of purchase which offers the perk of a Windows and a Mac installation disc, you need to purchase from an authorized reseller who is not going to offer you "upgraded pricing". The seller would be its own entity with its own pricing and own return/refund policy. Sometimes the authorized reseller price may be less than the Adobe"upgraded pricing".
    Did you purchase your Premiere Elements 13 Mac from Adobe direct and are within 30 days of purchase? If so, you can contact Adobe Chat Orders to ask for return/refund. And, then you can explore the authorized resellers for pricing and availability of the box packaging. Maybe check out the pricing all around before making any final decisions.
    Please review and consider.
    Thank you.
    ATR

  • How to get the Windows Vista Driver for ATI Radeon 7500 card?

    How to get the Windows Vista Driver for ATI Radeon 7500 card?
    I am using a IBM Thinkpad T42 with a 32Mb ATI Radeon 7500 graphic card AGP.
    Is there any Vista 32-bit driver to update my card so that this system support Aero effect?
    Thank you.
    regards,
    W. Thong

    wthong wrote:
    How to get the Windows Vista Driver for ATI Radeon 7500 card?
    The Radeon 9000 driver works for the Radeon 7500 card.  I have successfully used it on a T43 with Vista Ultimate x86
    wthong wrote:
    Is there any Vista 32-bit driver to update my card so that this system support Aero effect?
    Unfortunately no.  The Radeon 9000 driver should bring your graphics score up to close to 2, but it will not get it high enough to enable Aero support.
    Cheers,
    Bill
    I don't work for Lenovo

  • Satellite Pro A300 - I get the "Windows search" if I left click any folder

    I have just purchased a Satellite Pro A300 and downgraded it to Windows XP SP3.
    When I left-click any folder icon on my hard drive I get the 'Windows Search' window displayed instead of opening the folder. When I right-click any folder icon, the first item in the menu (bolded) is 'Search'.
    How can I change the order of these menu items so as 'Open' is the first item?
    Can I remove (Control Panel-Add or Remove Programs) the Windows Search facility without affecting any software I have loaded?
    Is having the Windows Search facility installed the likely cause of my problem?
    Thanks,
    Murray

    Have just solved my own problem:
    1. The order of items in the shortcut menu for Folders can be changed by updating the actions for specified file types in the Folder Options Menu. Select +Folder Options+ from the +Tools+ menu of any folder, select +File Types+ and scroll down to *Folder*. Click *Advanced* then click *New* and add *Open* with *Explorer* as the program to use. Click *OK* and *Close* and bingo! Appears the order of the short-cut menu in XP is Open before search, but in XP Pro is Search followed by Open/Explore.
    2. The Windows Search utility can be safely removed despite the warning issued - the Microsoft website indicates the warning is simply a generic warning and it is highly unlikely that removal will affect any software installed since the Search utility was loaded.
    3. The Windows Search utility was NOT the cause of this problem.
    Trust this might save others the hours of research I had to do to find this solution ...

  • Query to get the windows-user(os)

    Hallo,
    I have a windows operating system and on this system is oracle database with the
    spatial-option installed. Now I wanna create a trigger which writes in a table if
    a geometry is updated. In this table I wanna write the new geometry, the time of
    the update and the windows-user that logged on the windows operating system. I
    don't wanna know the database user.
    What is the sql-query to get the windows-user?
    Thanks Katrin

    As an alternative, use the SYS_CONTEXT function to get some of this info.
    oracle@fuzzy:~> sqlplus test/test@XE
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 2 16:32:53 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> select sys_context('USERENV', 'HOST') Host,
      2         sys_context('USERENV', 'IP_ADDRESS') IP,
      3         sys_context('USERENV', 'OS_USER') OS_User,
      4         sys_context('USERENV', 'AUTHENTICATED_IDENTITY') Identity
      5    from dual;
    HOST    IP          OS_USER   IDENTITY
    fuzzy    127.0.0.2  oracle    test
    SQL>                                           More info at http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions165.htm#i1038176

  • HT3986 I got a plain macbook (not a pro) that I got on 2010 and I've lost the CD's that came with it, can I still download Windows7? If yes, can someone please send me a link where I can get the windows? Thanks

    I got a plain macbook (not a pro) that I got on 2010 and I've lost the CD's that came with it, can I still download Windows7? If yes, can someone please send me a link where I can get the windows? Thanks

    Thanks stevejobsfan0123 for the reply, I know I have to buy a disk but when I searched for it on amazon I read many reviews about saying that either it is inadequate or that it's a scam. Do you know any website where I can get a legitimate disk of windows7?

  • Why do I keep getting the windows messenger error even after disabling it?

    Hi,
         I am trying to download the flash player 10 on my windows XP computer. I get the error(s) close "Internet Explorer" and close "Windows messenger" during download. I closed Internet Explorer ok, but still keep getting the Windows messenger error even after stopping it and disabling it. I also have IT on medium and firewall and antivirus disabled.
       How do I fix this problem. Please help. I need a flash player for work...Thanks
    Nitrowizard88

    ok, Here is whats listed
    flash10l.oxc active x control
    flashinstall, log
    flashutil10l_activex.dll
    flashutil10l_activex.exe
    genuist.exe
    kb923789.inf
    install.log
    I think I am running IE7
    32 bit..not sure on this...

  • Get the window title?

    I want to use the method AVWindowGetTitle(AVWindow window, ASText text) to get the window's title, but it even cannot be built successfully. When building the project, it always says "AVTArraySize(_cdecl *)(AVWindow, char *, AVTbufferSize)': too few arguments for call". But it's explictly, I called AVWindowGetTitle but not AVTArraySize... In our SDK's samples, we also call AVWindowGetTItle, why it cannot pass in my code?
    The purpose I get the title is Adobe sdk does recongnize pdf file name in Chinese, so I want to have a try to get the title of the window. If any other way we can get the Chinese name of the file, that would be better.
    Thanks a lot.
    Thanks
    Daniel

    You don't mention what version of the SDK you are using with what compiler on what OS platform.
    Acrobat 9 and X SDKs (which are the only ones supported at this time) work just fine with Chinese filenames.  What API calls are you using that do not?
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Thu, 24 Nov 2011 05:00:01 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: get the window title?
    get the window title?
    created by aaaawerewedsv<http://forums.adobe.com/people/aaaawerewedsv> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4044745#4044745

  • Just installed windows 7 Ultimate using Boot Camp. Problem is when I chose to boot the windows partition, I get the windows icon on the sreen showing that it is starting, but few second after I get a black screen

    Just installed windows 7 Ultimate using Boot Camp. Problem is when I choose to boot the windows partition, I get the windows icon on the screen showing that it is starting, but few second after, I get a blank screen. I suspect a driver (screen) issue, since I also installed Parallell using the boot camp partition and that works fine.
    Do anybody out there has an ideal of what to do to solve this issue.
    Thanks
    Pierre317

    Hi Pierre,
    more tips can be found here ...

  • HT204370 Trying to play my recently downloaded iTunes movie rentals. When opening I get the window "Cannot Open".  Others previously worked fine, internet connection is good, and payments went thru fine.  Please advise. Thx!

    iTunes movies won't play.  (Previously others worked fine.)  When I open the movies i get the window "Cannot Open".  Internet connection is fine, payment went thru fine.  Please advise...thx!

    Thankyou for the two replies.
    I have some good news but I still am concerned about why this happened?
    Using iTunes, I deleted then re-synced the video files that wouldn't play and now all of them play again.
    As I don't know why this problem occured, I am concerned about it happening again...it is NOT fun to have to delete and reload all of these vids, but, at least I know that there is some kind of "workaround"!
    If anyone has an idea of WHY this happened and, perhaps how to prevent it in the future, I would appreciate that input despite the fact that all my vids now play again.
    Chuck Proche

  • I recently subscribed to acrobat pro. I downloaded it, but can't open it. I keep getting the window saying application quit unexpectedly.  I running Mavericks. Is that a separate download? Where do I get it?

    I recently subscribed to acrobat pro. I downloaded it, but can’t open it. I keep getting the window saying application quit unexpectedly. I running Mavericks. Is that a separate download? Where do I get it? I downloaded on Safari. Should I have used Firefox?

    Hi Kenglade,
    Are you still facing this issue?
    If yes please try follow below mentioned steps and let me know if that helps:
        1. Start you Mac in Safe Mode: http://support.apple.com/kb/HT1564?viewlocale=en_US
        2. Once you are in Safe mode, Disk repair using Disk utility: https://us.battle.net/support/en/article/repair-disk-permissions-and-repair-disk
        3. If the above steps didn’t help, you may try to enable root account and check the issue from there
        How to enable root account: http://support.apple.com/kb/PH14281 
    Regards,
    Ajlan Huda.

  • Web Application getting the Windows NT User ID

    Is there a way within the web Oracle application to get the Windows NT User ID of the client running the application?
    Thanks in advance.

    For 6i, there is a bean example that works
    out of the box for that purpose.
    The only thing you have to keep in mind is
    that using Jinitiator, you have to create
    an identity and populate it with the provided
    certificate ON EVERY CLIENT MACHINE.
    Using IE5 native VM, there is no need for that, provided that you can live with granting some privileges to unsigned java code. (Signing is kinda tricky, I failed anyway...)
    If you are running 6.0, I posted an example
    (for the client hostname) that works under 6.0 a couple weeks back ("Getting Client Info"), an it can easily be modified to return the NT userid.
    Regards
    Anton

Maybe you are looking for

  • Document edits not printing

    Afternoon All, Supporting a user using Acrobat 9.0 (Standard / Professional etc. unknown but this can be found out) who has received a PDF as an attachment in an email. When she opens it, the edits that were made by a previous user to the document sh

  • "no entries in this view".

    Q10 Auto upload of new OS release 10.2.1.2102. The Text Message screen no loner displays anything. "no entries in this view". Has anyone seen this and is there a solution? Thank you. Solved! Go to Solution.

  • I randomly get this: name of your computer is already in use

    Does anyone know how to fix this? I have comcast that is IPv6 and probabnly IPv4 as well. I have the tower Airport Extreme, firmware updated MacPro, 10.9.2, Airport card turned off, using only ethernet. One Trendnet Gigabyte Green switch. I have been

  • Boot From Time Capsule

    Is it possible to boot from Time Capsule? I don't see any FireWire Ports.

  • Web Browsers for e51

    I was just wondering if anyone knows of any web browsers for the e51 that allow the use of proxy settings? If so please can you tell me where to find them?