API JNA e Threads - FORZEN WINDOW

I'm creating one aplication JAVA DESKTOP for open the WEBCAM USB or NATIVE.
I'm using JNA for open library native windows avicap.dll
My system operation is Windows 7
I have 3 interfaces:
One have name MapHWND
package interf;
import com.sun.jna.FromNativeContext;
import com.sun.jna.Pointer;
import com.sun.jna.PointerType;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIFunctionMapper;
import com.sun.jna.win32.W32APITypeMapper;
import java.util.HashMap;
import java.util.Map;
public interface MapHWND extends StdCallLibrary{
Map UNICODE_OPTIONS = new HashMap() {
put(OPTION_TYPE_MAPPER, W32APITypeMapper.UNICODE);
put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.UNICODE);
Map ASCII_OPTIONS = new HashMap() {
put(OPTION_TYPE_MAPPER, W32APITypeMapper.ASCII);
put(OPTION_FUNCTION_MAPPER, W32APIFunctionMapper.ASCII);
Map DEFAULT_OPTIONS = Boolean.getBoolean("w32.ascii") ? ASCII_OPTIONS
: UNICODE_OPTIONS;
public static class HANDLE extends PointerType {
@Override
public Object fromNative(Object nativeValue, FromNativeContext context) {
Object o = super.fromNative(nativeValue, context);
if (INVALID_HANDLE_VALUE.equals(o)) {
return INVALID_HANDLE_VALUE;
return o;
public static class HWND extends HANDLE {
HANDLE INVALID_HANDLE_VALUE = new HANDLE() {
super.setPointer(Pointer.createConstant(-1));
@Override
public void setPointer(Pointer p) {
throw new UnsupportedOperationException("Immutable reference");
Other have name Avicap32:
package interf;
import com.sun.jna.win32.StdCallLibrary;
public interface Avicap32 extends StdCallLibrary, MapHWND{
//Métodos
public int capCreateCaptureWindowA(
String lpszWindowName, //Create a function od capture windows
int dwStye, //style of window
int x, //..
int y, //..
int nWidth, //..
int nHeight, //position and size of window
int hWndParent, /identify of father window
int nID); //window ID
//********************************* Constantes ********************************
public static final short WM_USER = 1024;
public static final int WM_CAP_START = WM_USER;
public static int WS_CHILD = 0x40000000;
public static int WS_VISIBLE = 0x10000000;
public static int SWP_NOZORDER = 0x4;
public static int HWND_BOTTOM = 1;
public static int SWP_NOMOVE = 0x2;
// Defines start of the message range
public static final int WM_CAP_GET_CAPSTREAMPTR = (WM_CAP_START+ 1);
public static final int WM_CAP_SET_CALLBACK_ERROR = (WM_CAP_START+ 2);
public static final int WM_CAP_SET_CALLBACK_STATUS = (WM_CAP_START+ 3);
public static final int WM_CAP_SET_CALLBACK_YIELD = (WM_CAP_START+ 4);
public static final int WM_CAP_SET_CALLBACK_FRAME = (WM_CAP_START+ 5);
public static final int WM_CAP_SET_CALLBACK_VIDEOSTREAM = (WM_CAP_START+ 6);
public static final int WM_CAP_SET_CALLBACK_WAVESTREAM = (WM_CAP_START+ 7);
public static final int WM_CAP_GET_USER_DATA = (WM_CAP_START+ 8);
public static final int WM_CAP_SET_USER_DATA = (WM_CAP_START+ 9);
public static final int WM_CAP_DRIVER_CONNECT = 0x40a;//(WM_CAP_START+ 10);
public static final int WM_CAP_DRIVER_DISCONNECT = (WM_CAP_START+ 11);
public static final int WM_CAP_DRIVER_GET_NAME = (WM_CAP_START+ 12);
public static final int WM_CAP_DRIVER_GET_VERSION = (WM_CAP_START+ 13);
public static final int WM_CAP_DRIVER_GET_CAPS = (WM_CAP_START+ 14);
public static final int WM_CAP_FILE_SET_CAPTURE_FILE = (WM_CAP_START+ 20);
public static final int WM_CAP_FILE_GET_CAPTURE_FILE = (WM_CAP_START+ 21);
public static final int WM_CAP_FILE_ALLOCATE = (WM_CAP_START+ 22);
public static final int WM_CAP_FILE_SAVEAS = (WM_CAP_START+ 23);
public static final int WM_CAP_FILE_SET_INFOCHUNK = (WM_CAP_START+ 24);
public static final int WM_CAP_FILE_SAVEDIB = (WM_CAP_START+ 25);
public static final int WM_CAP_EDIT_COPY = (WM_CAP_START+ 30);
public static final int WM_CAP_SET_AUDIOFORMAT = (WM_CAP_START+ 35);
public static final int WM_CAP_GET_AUDIOFORMAT = (WM_CAP_START+ 36);
public static final int WM_CAP_DLG_VIDEOFORMAT = (WM_CAP_START+ 41);
public static final int WM_CAP_DLG_VIDEOSOURCE = (WM_CAP_START+ 42);//usb
public static final int WM_CAP_DLG_VIDEODISPLAY = (WM_CAP_START+ 43);
public static final int WM_CAP_GET_VIDEOFORMAT = (WM_CAP_START+ 44);
public static final int WM_CAP_SET_VIDEOFORMAT = (WM_CAP_START+ 45);
public static final int WM_CAP_DLG_VIDEOCOMPRESSION = (WM_CAP_START+ 46);
public static final int WM_CAP_SET_PREVIEW = 0x432;//(WM_CAP_START+ 50);
public static final int WM_CAP_SET_OVERLAY = (WM_CAP_START+ 51);
public static final int WM_CAP_SET_PREVIEWRATE = 0x434;//(WM_CAP_START+ 52);
public static final int WM_CAP_SET_SCALE = 0x435;//(WM_CAP_START+ 53);
public static final int WM_CAP_GET_STATUS = (WM_CAP_START+ 54);
public static final int WM_CAP_SET_SCROLL = (WM_CAP_START+ 55);
public static final int WM_CAP_GRAB_FRAME = (WM_CAP_START+ 60);
public static final int WM_CAP_GRAB_FRAME_NOSTOP = (WM_CAP_START+ 61);
public static final int WM_CAP_SEQUENCE = (WM_CAP_START+ 62);
public static final int WM_CAP_SEQUENCE_NOFILE = (WM_CAP_START+ 63);
public static final int WM_CAP_SET_SEQUENCE_SETUP = (WM_CAP_START+ 64);
public static final int WM_CAP_GET_SEQUENCE_SETUP = (WM_CAP_START+ 65);
public static final int WM_CAP_SET_MCI_DEVICE = (WM_CAP_START+ 66);
public static final int WM_CAP_GET_MCI_DEVICE = (WM_CAP_START+ 67);
public static final int WM_CAP_STOP = (WM_CAP_START+ 68);
public static final int WM_CAP_ABORT = (WM_CAP_START+ 69);
public static final int WM_CAP_SINGLE_FRAME_OPEN = (WM_CAP_START+ 70);
public static final int WM_CAP_SINGLE_FRAME_CLOSE = (WM_CAP_START+ 71);
public static final int WM_CAP_SINGLE_FRAME = (WM_CAP_START+ 72);
public static final int WM_CAP_PAL_OPEN = (WM_CAP_START+ 80);
public static final int WM_CAP_PAL_SAVE = (WM_CAP_START+ 81);
public static final int WM_CAP_PAL_PASTE = (WM_CAP_START+ 82);
public static final int WM_CAP_PAL_AUTOCREATE = (WM_CAP_START+ 83);
public static final int WM_CAP_PAL_MANUALCREATE = (WM_CAP_START+ 84);
// Following added post VFW 1.1
public static final int WM_CAP_SET_CALLBACK_CAPCONTROL = (WM_CAP_START+ 90);
// Defines end of the message range
public static final int WM_CAP_END = WM_CAP_SET_CALLBACK_CAPCONTROL;
public static final int IDS_CAP_BEGIN = 300; //(* "Capture Start" *)
public static final int IDS_CAP_END = 301; //(* "Capture End" *)
public static final int IDS_CAP_INFO = 401; //(* "%s" *)
public static final int IDS_CAP_OUTOFMEM = 402; //(* "Out of memory" *)
public static final int IDS_CAP_FILEEXISTS = 403; //(* "File '%s' exists -- overwrite it?" *)
public static final int IDS_CAP_ERRORPALOPEN = 404; //(* "Error opening palette '%s'" *)
public static final int IDS_CAP_ERRORPALSAVE = 405; //(* "Error saving palette '%s'" *)
public static final int IDS_CAP_ERRORDIBSAVE = 406; //(* "Error saving frame '%s'" *)
public static final int IDS_CAP_DEFAVIEXT = 407; //(* "avi" *)
public static final int IDS_CAP_DEFPALEXT = 408; //(* "pal" *)
public static final int IDS_CAP_CANTOPEN = 409; //(* "Cannot open '%s'" *)
public static final int IDS_CAP_SEQ_MSGSTART = 410; //(* "Select OK to start capture\nof video sequence\nto %s." *)
public static final int IDS_CAP_SEQ_MSGSTOP = 411; //(* "Hit ESCAPE or click to end capture" *)
public static final int IDS_CAP_VIDEDITERR = 412; //(* "An error occurred while trying to run VidEdit." *)
public static final int IDS_CAP_READONLYFILE = 413; //(* "The file '%s' is a read-only file." *)
public static final int IDS_CAP_WRITEERROR = 414; //(* "Unable to write to file '%s'.\nDisk may be full." *)
public static final int IDS_CAP_NODISKSPACE = 415; //(* "There is no space to create a capture file on the specified device." *)
public static final int IDS_CAP_SETFILESIZE = 416; //(* "Set File Size" *)
public static final int IDS_CAP_SAVEASPERCENT = 417; //(* "SaveAs: %2ld%% Hit Escape to abort." *)
public static final int IDS_CAP_DRIVER_ERROR = 418; //(* Driver specific error message *)
public static final int IDS_CAP_WAVE_OPEN_ERROR = 419; //(* "Error: Cannot open the wave input device.\nCheck sample size, frequency, and channels." *)
public static final int IDS_CAP_WAVE_ALLOC_ERROR = 420; //(* "Error: Out of memory for wave buffers." *)
public static final int IDS_CAP_WAVE_PREPARE_ERROR = 421; //(* "Error: Cannot prepare wave buffers." *)
public static final int IDS_CAP_WAVE_ADD_ERROR = 422; //(* "Error: Cannot add wave buffers." *)
public static final int IDS_CAP_WAVE_SIZE_ERROR = 423; //(* "Error: Bad wave size." *)
public static final int IDS_CAP_VIDEO_OPEN_ERROR = 424; //(* "Error: Cannot open the video input device." *)
public static final int IDS_CAP_VIDEO_ALLOC_ERROR = 425; //(* "Error: Out of memory for video buffers." *)
public static final int IDS_CAP_VIDEO_PREPARE_ERROR = 426; //(* "Error: Cannot prepare video buffers." *)
public static final int IDS_CAP_VIDEO_ADD_ERROR = 427; //(* "Error: Cannot add video buffers." *)
public static final int IDS_CAP_VIDEO_SIZE_ERROR = 428; //(* "Error: Bad video size." *)
public static final int IDS_CAP_FILE_OPEN_ERROR = 429; //(* "Error: Cannot open capture file." *)
public static final int IDS_CAP_FILE_WRITE_ERROR = 430; //(* "Error: Cannot write to capture file. Disk may be full." *)
public static final int IDS_CAP_RECORDING_ERROR = 431; //(* "Error: Cannot write to capture file. Data rate too high or disk full." *)
public static final int IDS_CAP_RECORDING_ERROR2 = 432; //(* "Error while recording" *)
public static final int IDS_CAP_AVI_INIT_ERROR = 433; //(* "Error: Unable to initialize for capture." *)
public static final int IDS_CAP_NO_FRAME_CAP_ERROR = 434; //(* "Warning: No frames captured.\nConfirm that vertical sync interrupts\nare configured and enabled." *)
public static final int IDS_CAP_NO_PALETTE_WARN = 435; //(* "Warning: Using default palette." *)
public static final int IDS_CAP_MCI_CONTROL_ERROR = 436; //(* "Error: Unable to access MCI device." *)
public static final int IDS_CAP_MCI_CANT_STEP_ERROR = 437; //(* "Error: Unable to step MCI device." *)
public static final int IDS_CAP_NO_AUDIO_CAP_ERROR = 438; //(* "Error: No audio data captured.\nCheck audio card settings." *)
public static final int IDS_CAP_AVI_DRAWDIB_ERROR = 439; //(* "Error: Unable to draw this data format." *)
public static final int IDS_CAP_COMPRESSOR_ERROR = 440; //(* "Error: Unable to initialize compressor." *)
public static final int IDS_CAP_AUDIO_DROP_ERROR = 441; //(* "Error: Audio data was lost during capture, reduce capture rate." *)
//(* status string IDs *)
public static final int IDS_CAP_STAT_LIVE_MODE = 500; //(* "Live window" *)
public static final int IDS_CAP_STAT_OVERLAY_MODE = 501; //(* "Overlay window" *)
public static final int IDS_CAP_STAT_CAP_INIT = 502; //(* "Setting up for capture - Please wait" *)
public static final int IDS_CAP_STAT_CAP_FINI = 503; //(* "Finished capture, now writing frame %ld" *)
public static final int IDS_CAP_STAT_PALETTE_BUILD = 504; //(* "Building palette map" *)
public static final int IDS_CAP_STAT_OPTPAL_BUILD = 505; //(* "Computing optimal palette" *)
public static final int IDS_CAP_STAT_I_FRAMES = 506; //(* "%d frames" *)
public static final int IDS_CAP_STAT_L_FRAMES = 507; //(* "%ld frames" *)
public static final int IDS_CAP_STAT_CAP_L_FRAMES = 508; //(* "Captured %ld frames" *)
public static final int IDS_CAP_STAT_CAP_AUDIO = 509; //(* "Capturing audio" *)
public static final int IDS_CAP_STAT_VIDEOCURRENT = 510; //(* "Captured %ld frames (%ld dropped) %d.%03d sec." *)
public static final int IDS_CAP_STAT_VIDEOAUDIO = 511; //(* "Captured %d.%03d sec. %ld frames (%ld dropped) (%d.%03d fps). %ld audio bytes (%d,%03d sps)" *)
public static final int IDS_CAP_STAT_VIDEOONLY = 512; //(* "Captured %d.%03d sec. %ld frames (%ld dropped) (%d.%03d fps)" *)
public static final int IDS_CAP_STAT_FRAMESDROPPED = 513; //(* "Dropped %ld of %ld frames (%d.%02d%%) during capture." *)
And fiishing, the interface User32:
package interf;
import com.sun.jna.win32.StdCallLibrary;
public interface User32 extends StdCallLibrary, MapHWND{   
public boolean DestroyWindow(int hndw);
public boolean ShowWindow(long hWnd, int nCmdShow);
public HWND FindWindow(String winClass, String title);
public int SetWindowPos(
int hwnd,
int hWndInsertAfter,
int x,
int y,
int cx,
int cy,
int wFlags);
public int SendMessageA(
int hwnd,
int wMsg,
int wParam,
int lParam);
I have a JFrame with a botton and a painel of palet AWT.
In the universal variables and threading
//chamando as APIs
Avicap32 libA = (Avicap32) Native.loadLibrary("AviCap32", Avicap32.class);
User32 libU = (User32) Native.loadLibrary("User32", User32.class);
int hWnd;
int DeviceID = 0;
String DeviceIndex = String.valueOf(DeviceID);
int id, idt;
public class LoopFrame implements Runnable{
@Override
public void run() {                            
int i = 0;
libU.SendMessageA(hWnd, Avicap32.WM_CAP_DRIVER_CONNECT, DeviceID, id);
for(;;){                   
//libU.SendMessageA(hWnd, Avicap32.WM_CAP_SET_SCALE, 0, hWnd);
//libU.SendMessageA(hWnd, Avicap32.WM_CAP_SET_PREVIEWRATE, 66, hWnd);
//libU.SendMessageA(hWnd, Avicap32.WM_CAP_SET_PREVIEW, -1, hWnd);
libU.SendMessageA(hWnd, Avicap32.WM_CAP_GRAB_FRAME, -1, id);
libU.SetWindowPos(hWnd, Avicap32.HWND_BOTTOM, 0, 0, 320, 240, Avicap32.SWP_NOMOVE | Avicap32.SWP_NOZORDER);
System.out.print("\n"+i++);
public void starting(){
Thread thrLoop = new Thread(new LoopFrame());
repaint();
thrLoop.start();
In the event botton a have:
//pImga é o painel da paleta AWT
WComponentPeer cpp = (WComponentPeer) pImage.getPeer();
long h = cpp.getHWnd();
id = (int)h;
WComponentPeer cppT = (WComponentPeer) this.getPeer();
long hh = cppT.getHWnd();
idt = (int)hh;
try{ 
hWnd = libA.capCreateCaptureWindowA("0", Avicap32.WS_VISIBLE | Avicap32.WS_CHILD, 0, 0, 0, 0, id, 0);
}catch(Exception ex){JOptionPane.showMessageDialog(null, ex.toString());}
starting();
Executing, my apllication is frozen!
I don't that it's happening.
Please, someone explain me.

If you think somebody is going to debug your code, you are mistaken. So try to explain it yourself. If you don't know how to use a debugger, add debugging System.out.println statements everywhere to narrow down which code is actually executed and which is not. If something is locking up, you'll be able to find it. And the next time you post code:
a) only post relevant code. Nobody needs to see that native stuff
b) put it between \ tags so it is actually readable.
Do your best to make it possible to be helped.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • I have been able to open PDF docs using C# API Process.Start("Full_path_To_the_PDF_File") in windows 7 or windows 8 with all previous versions of Acrobat32 reader.

    I have been able to open PDF docs using C# API Process.Start("Full_path_To_the_PDF_File") in windows 7 or windows 8 with all previous versions of Acrobat32 reader.
    However, with v11.0, the same command, in Windows 8, it does not open the PDF document. I can see the Acrobat(32) started in the task manager, but the document does open. Not sure how I can troble shoot this problem. Any help would be appreciated.

    I haven't use the C# API but I imagine it is the same as C ShellExecute. Which in turn is the same thing (in essence) as double clicking in Windows Explorer.
    So... does Adobe Reader run normally on this machine?
    And does it start and open if you double click on a PDF file?

  • Is there any separate api to access emails in windows mobiles

    is there any separate api to access emails in windows mobiles

    Of course there is an API to repository objects, and the SUN/iPlanet people are using it. Also in past times Forte-partners have used it. You can see the classes when you set certain cfg. flags. The problem is, there is no documentation about that API provided by SUN. If you find an expert within the community (who is not bound by a non disclosure ), it will be rather easy to set up C++ wrappers to integrate with an external (non TOOL) application.
    We feel a need for documented access to the repository objects as well, as that would make several tasks of development automatization and integration with other development tools (Forte for JAVA e.g.) more straight forward.

  • Problem with StatelessConnectionPool and Threads on Windows XP

    I am trying to use a StatelessConnectionPool in a multithreaded app under Windows using 10g. The problem is that when my application is exiting and I go to terminate the StatelessConnectionPool, I get an access violation inside Environment::terminateStatlessConnectionPool.
    A short program that demonstrates the problem is at the end of this post. One thing I have noticed is that by calling terminateConnection inside the thread instead of releaseConnection the problem goes away. However, performance really degrades. Thanks in advance.
    #include <windows.h>
    #include <occi.h>
    #include "RegisterDataMappings.h"
    #include "Consumers.h"
    #include "Thread.h"
    using namespace oracle::occi;
    Environment* env = NULL;
    StatelessConnectionPool* connPool = NULL;
    //Derived from opur Thread class
    class TestThread : public Thread
    public:
         TestThread(void){}
    protected:
         //get an object 10 times, sleeping every 500 msecs in between
         virtual DWORD run(void)
              printf("Thread 0x%08x Enter...\n", GetCurrentThreadId());
              Sleep(500);
              int i = 0;
              while(i < 10)
                   try
                        Connection* conn = connPool->getConnection();
                        Statement* stmt = conn->createStatement("select Ref(c) from consumers c where pid = 7038878582");
                        ResultSet* rs = stmt->executeQuery();
                        if(rs->next())
                             Ref<Consumers> consumer = rs->getRef(1);
                             printf("Thread 0x%08x #%d - %.0f\n", GetCurrentThreadId(), i+1, (double)consumer->getconsumerid());
                        stmt->closeResultSet(rs);
                        conn->terminateStatement(stmt);
                        connPool->releaseConnection(conn);
                        //connPool->terminateConnection(conn);
                        Sleep(500);
                        ++i;
                   catch(SQLException& sql)
                        printf("Oracle exception: %s\n", sql.getMessage().c_str());
              printf("Thread 0x%08x Leave...\n", GetCurrentThreadId());
              return 0;
    //Helper function to create a connection
    void createConnection(void)
         env = Environment::createEnvironment((Environment::Mode)(Environment::OBJECT|Environment::THREADED_MUTEXED));
         RegisterDataMappings(env);
         connPool = env->createStatelessConnectionPool("user", "pass", "orcldev", 10, 10, 0, StatelessConnectionPool::HOMOGENEOUS);
    //Helper function to terminate a connection
    void terminateConnection(void)
         env->terminateStatelessConnectionPool(connPool);
         Environment::terminateEnvironment(env);
    int main(int argc, char* argv[])
         try
              //Connect to the database
              createConnection();
              //Create 10 threads and wait for them to complete
              const int numThreads = 10;
              HANDLE handles[numThreads];
              for(int i = 0; i < numThreads; i++)
                   TestThread* thread = new TestThread;
                   thread->start();
                   handles[i] = thread->getThreadHandle();
              WaitForMultipleObjects(numThreads, handles, TRUE, INFINITE);
              //Clean up
              terminateConnection();
         catch(SQLException& sql)
              printf("SQLException caught: %s\n", sql.getMessage().c_str());
         return 0;

    When I search MetaLink for bug 4183098, it says there's nobug 4183098. Any information on this?

  • AIR 1.5.3 Generates 1000+ threads on Windows and Crashes...

    I'm writing a fairly large AIR application that, at one point, begins creating threads over and over.The thread count will reach 1000+ before finally crashing.
    Notes:
    This *only* crashes Windows 7 and Vista
    The thread count on XP increases the same as Win7 and Vista; however, the application does not crash in XP
    On a mac, the thread count barely makes it past 30, and obviously, does not crash.
    When using ADL via flexbuilder, adl.exe's thread count only increases to around 200 or so (thus, no crash). This only occurs when the application is installed.
    This issue seems very closely related to garbage collection (due to the actual thread count being variable -- as well as the crash). I'd say the crash occurs 90% of the time and the other 10%, the thread count may only get to 900 or so, before dropping back down to 15 or so - this does *not* crash the application.
    This is a fairly serious matter from my company's perspective, and *any* feedback at all would be GREATLY appreciated.
    Thanks!
    Matt Bolt
    [email protected]
    Electrotank, Inc.

    I'm adding in my own answer of "what" causes this; however, I still believe it's a bug...
    We were using URLMonitor to verify whether or not an asset existed -- Each urlMonitor instantiation and start() method calls generated an additional thread - for certain objects, we were checking for multiple assets (thus the 1000+ threads). This still may be related to garbage collection, but it was definitely the URLMonitor that sparked the issue.

  • Kuler API doesn't work with Windows 8 apps

    Hi, I've been trying to get the Kuler API to work with my app for Windows 8 (I'm using C# and XAML). For example:
    string feed = await client.GetStringAsync("https://kuler-api.adobe.com/rss/get.cfm?listType=" + type + "&itemsPerPage=" + items + "&timeSpan=" + timeSpan + "&key=" + key);
    However this throws a Http Request Excepion and tells me: "The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF".
    This request worked absolutely fine a while ago but now it throws that exception. If I paste the url into a web browser like Chrome it works fine because Chrome ignores errors like this. Is there any way of fixing this problem? Thanks.
    Edit: if the issue can't be resolved, can anyone give an update as to when the new API system is going to be in operation? I haven't heard anything since May and it's now July.

    See:
    *https://support.mozilla.org/kb/windows-media-or-other-plugins-stopped-working
    There has been a change in where Firefox searches for plugins and the plugins folder in the Firefox program folder is no longer scanned for plugins, so Firefox won't find them anymore if they are installed in the plugins folder instead of the "browser\plugins" folder that Firefox now scans.
    You can set the plugins.load_appdir_plugins pref to true on the about:config page to make Firefox scan the "<install>/plugins/" directory for plugins like the WMP plugin (np-mswmp.dll).
    You can alternatively move plugins from "<install directory>\plugins\" to "<install directory>\browser\plugins\" (create this folder when missing) to make Firefox find them again.
    *http://www.ghacks.net/2013/05/15/why-you-may-have-lost-access-to-plugins-or-extensions-in-firefox-21/
    *http://mike.kaply.com/2013/04/24/major-changes-coming-in-firefox-21/

  • Application Restart and Recovery APIs doesn't work for windows services

    I am using the Application Restart and Recovery mechanism (provided in Windows API Code Pack for Microsoft.NET Framework) to collect some information (i.e. stack information when there's an unhandledexception)  before my windows service crash down.
    It works well for windows form applications, but the callback method wouldn't be called if the host is a windows service. 
    I have checked the article: https://msdn.microsoft.com/zh-cn/subscriptions/downloads/cc303708
    But it doesn't specify clearly whether it works for a windows service. It seems that the recovery will only be activated when the user interacts with the error dialog of Windows Error Reporting (clicking "close" on the dialog, for example).
    So I am wondering is my guess right that the Application Restart and Recovery mechanism doesn't work for windows services. Or is there a better way to meet my requirement? 

    I would suggest trying ARR if that's what you want to use.  The restart portion won't work, but it doesn't need to as if you fail out of your service, the Windows service controller will handle recovery (up to and including restarting your service).
     You configure those recovery actions either through code or one of the built in administrative tools for services such as services.msc.  
    DebugDiag/ADplus and similar tools ultimately do use built-in APIs; you don't need to add anything external to collect debugging information.  You do however have to write a good deal of code to do somethings.  It's pretty simple to use the unmanaged
    function that I pointed out before and
    MiniDumpWriteDump to write a minidump when you hit an unexpected error(the dbghelp.dll that comes installed with Windows has it so you don't need anything additional installed).  You can even write a basic debugger that literally debugs a process using
    only kernel32 functions (see
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms679301(v=vs.85).aspx if you're interested).  
    WinSDK Support Team Blog: http://blogs.msdn.com/b/winsdk/

  • Facebook API Login with the login window loaded in html component

    I am making an air app which utilises net based content such as bringing viewing their facebook photos within the app itself but I DON'T want my users to be able to browse to the internet or more specifically open up internet explorer. Problem is the facebook api requires the user to go to a facebook login page when the login for the facebook session is fired. Is there any way I can ghet this to open up in a html component rather than internet explorer? The facebooksession.login() seems to open up this window by default and doing the validatelogin without this seems to throw a null object reference error.
    Can anybody help please? Here's my code:-
    public function facebookLoginButtonClick():void{
    facebookSession = new FacebookSessionUtil("blah","blah",stage.loaderInfo);
    facebookSession.addEventListener(FacebookEvent.WAITING_FOR_LOGIN, facebookHandle_waitingForLogin);
    facebookSession.addEventListener(FacebookEvent.CONNECT, facebookHandle_connect);
    facebookSession.login();
    private function facebookHandle_waitingForLogin(event:FacebookEvent):void{
    var facebookAlert:Alert = Alert.show("Click OK After You've logged in to Facebook", "Logging In");
    facebookAlert.addEventListener(Event.CLOSE, facebookHandle_close);
    private function facebookHandle_close(event:Event):void{
    facebookSession.validateLogin();
    private function facebookHandle_connect(event:FacebookEvent):void{
    var facebookCall:FacebookCall = facebookSession.facebook.post(new GetInfo([facebookSession.facebook.uid],['name', 'pic_square']));
    facebookCall.addEventListener(FacebookEvent.COMPLETE, facebookHandle_getInfoComplete);
    private function facebookHandle_getInfoComplete(event:FacebookEvent):void{
    var facebookGetInfoData:GetInfoData = GetInfoData(event.data);
    var facebookUser:FacebookUser = FacebookUser(facebookGetInfoData.userCollection.getItemAt(0));
    facebookUserAvatar.source = facebookUser.pic_square;
    facebookUsername.text = facebookUser.name;

    Try this:
    public function FacebookInterOp(loaderInfo) {
                session = new FacebookSessionUtil(API_KEY, SECRET, loaderInfo);
                session.addEventListener(FacebookEvent.CONNECT, onConnect);
                fbook = session.facebook;
                if (loaderInfo.parameters.fb_sig_session_key) {
                    session.verifySession();
                else {
                    session.login();
    You'll still get the pop up when you load the program in the debugger, but when loading from Facebook it should be seamless. I hope that helps.

  • GW API in Services / Threads

    I've had some issues dealing with the ADMIN API and threads and I solved my
    problems by keeping the GW API in the main thread. My Problem now is I run a
    Service that nees to run and I am getting the following message...
    Unable to cast COM object of type 'AdminTypeLibrary.SystemClass' to
    interface type 'AdminTypeLibrary.DIADSystem'. This operation failed because
    the QueryInterface call on the COM component for the interface with IID
    '{35FC2357-811A-11D0-8A96-00805FC16077}' failed due to the following error:
    No such interface supported (Exception from HRESULT: 0x80004002
    (E_NOINTERFACE)).
    Code Snippet:
    Dim oNovell As Object = New clsNovellAPINET
    Dim oTempNovell As Object = New clsNovellAPINET
    Dim strGroupwiseFileID As String
    Dim oGWSystem As New AdminTypeLibrary.System
    Dim oGWUsers As AdminTypeLibrary.IADUsers
    Dim oGWUser3 As AdminTypeLibrary.IADUser3
    Dim strGWPO, strGWDomain As String
    Dim MyReturn As Boolean = False
    Dim StriptedUserName As String
    Dim StriptedPO As String
    Dim StriptedDomain As String
    oNovell.FullName = "[ROOT]"
    oNovell.HighConfidenceMode = True
    oNovell.BoundObject = UserName
    strGroupwiseFileID = oNovell.GetFieldValue("NGW: File Id")
    Try
    If [String].IsNullOrEmpty(Trim(strGroupwiseFileID)) = False Then
    strGWPO = oNovell.GetFieldValue("NGW: Post Office").ToString
    oTempNovell.FullName = "[ROOT]"
    oTempNovell.HighConfidenceMode = True
    oTempNovell.BoundObject = strGWPO
    strGWDomain = oTempNovell.GetFieldValue("NGW:
    Domain").ToString
    *** oGWSystem.ConnectByDN(strGWDomain) 'ERRORS HERE
    oGWUsers = oGWSystem.Users
    I have narrowed this down to be a threading issues. Services that use timers
    to kick off sections of codes (Or in this Case a Class Library) still run
    under the Thread of the Timer. Not the main code (The service) does anyone
    know how to get around this perticular issue???????
    Thanks
    Michael Baker

    Yeah thats pretty much what I am finding and it's a pain in the butt. As a
    service you normally do not have access to the Primary thread.........I
    guesss I will have to be satified with a Scheduled task...Not sure If I want
    to try Delagates in a service.
    If the SOAP Admin API comes out lets Jump for joy....
    "John Baird" <[email protected]> wrote in message
    news:[email protected]...
    >I dont know if this is your problem, but I found that the GW Admin API
    > produced seemingly random exceptions if CoInitialize and CoCreateInstance
    > were called in any thread except the main thread. Providing I call those
    > in
    > the main thread, everything works fine.
    >
    > John
    >
    > "Michael Baker" <[email protected]> wrote in message
    > news:[email protected]...
    >> I've had some issues dealing with the ADMIN API and threads and I solved
    > my
    >> problems by keeping the GW API in the main thread. My Problem now is I
    >> run
    > a
    >> Service that nees to run and I am getting the following message...
    >>
    >> Unable to cast COM object of type 'AdminTypeLibrary.SystemClass' to
    >> interface type 'AdminTypeLibrary.DIADSystem'. This operation failed
    > because
    >> the QueryInterface call on the COM component for the interface with IID
    >> '{35FC2357-811A-11D0-8A96-00805FC16077}' failed due to the following
    > error:
    >> No such interface supported (Exception from HRESULT: 0x80004002
    >> (E_NOINTERFACE)).
    >>
    >>
    >> Code Snippet:
    >>
    >> Dim oNovell As Object = New clsNovellAPINET
    >> Dim oTempNovell As Object = New clsNovellAPINET
    >> Dim strGroupwiseFileID As String
    >> Dim oGWSystem As New AdminTypeLibrary.System
    >> Dim oGWUsers As AdminTypeLibrary.IADUsers
    >> Dim oGWUser3 As AdminTypeLibrary.IADUser3
    >> Dim strGWPO, strGWDomain As String
    >> Dim MyReturn As Boolean = False
    >> Dim StriptedUserName As String
    >> Dim StriptedPO As String
    >> Dim StriptedDomain As String
    >> oNovell.FullName = "[ROOT]"
    >> oNovell.HighConfidenceMode = True
    >> oNovell.BoundObject = UserName
    >> strGroupwiseFileID = oNovell.GetFieldValue("NGW: File Id")
    >> Try
    >> If [String].IsNullOrEmpty(Trim(strGroupwiseFileID)) = False
    > Then
    >> strGWPO = oNovell.GetFieldValue("NGW: Post
    > Office").ToString
    >> oTempNovell.FullName = "[ROOT]"
    >> oTempNovell.HighConfidenceMode = True
    >> oTempNovell.BoundObject = strGWPO
    >> strGWDomain = oTempNovell.GetFieldValue("NGW:
    >> Domain").ToString
    >>
    >> *** oGWSystem.ConnectByDN(strGWDomain) 'ERRORS HERE
    >>
    >> oGWUsers = oGWSystem.Users
    >>
    >>
    >> I have narrowed this down to be a threading issues. Services that use
    > timers
    >> to kick off sections of codes (Or in this Case a Class Library) still run
    >> under the Thread of the Timer. Not the main code (The service) does
    >> anyone
    >> know how to get around this perticular issue???????
    >>
    >> Thanks
    >> Michael Baker
    >>
    >>
    >
    >

  • Can i use unc or ucwa web api to build android and windows phone app ?

    is there anyway to develop custom client application using unc web api ( android, ios, windows phone ) with following features
    App to app audio / video calling
    App to app audio conference call
    App to app messaging 
     

    Instant messaging is perfectly supported already by UCWA, audio/video are not at this moment.
    UCWA can be used by any platform/device that can 'speak HTTP', so yes the platforms you mentioned are suitable UCWA clients.
    You may adopt third party solutions and combine them with UCWA within your app in order to achieve audio/video call support.
    HTH
    Massimo Prota
    .NET MCAD - SP2007 MCTS - SP2010 MCPD and MCITP
    My blog: http://blogs.ugidotnet.org/mprota - Twitter:
    @massimoprota

  • Threads on windows xp & jukebox zen driver installation and no resu

    I didn't know Creative didn't know how to solve the driver problem with windows xp. Because if they did there would be a simple solution instead of alot of run around on try this and that. There are so many people on this board with the same problem that I have and none of them got a straight answer on " Here this is what you do," Bam! that should be it. Obviously its a lousy software that doesn't really work. So if someone can tell me how to install a driver or make windows xp recognize my jukebox zen so I can transfer some music to the **bleep** thing I would really greatly appreciate it. We all shouldn't have to be geniuses to use this software.

    Try getting the latest drivers
    http://us.creative.com/support/downloads/download.asp

  • Calling a Single Threaded Win32 API/DLL

    I am working on calling a single threaded Win32 API (in a vendor's dll).
    Since this dll is single threaded in windows, when I call this in my Java program do I need to make sure that I do not have multiple threads calling this API.
    Any thoughts will be appreciated.
    Thanks

    It shouldn't matter as long as you make sure that multiple threads aren't calling functions in that DLL at the same time. You can ensure this by either synchronizing your methods in Java or writing a multithreaded stub DLL that synchronizes calls to the single-threaded DLL for you.

  • Windows XP Mode (Virtual PC) only uses half a CPU core/thread.

    Not only does windows xp mode not support multiple cores, to me it looks like it only uses half a core/thread.
    I noticed this because I just setup windows xp mode (virtual pc) on my computer.  I updated it, joined it to our domain and then installed our legacy ERP software.  This ERP software was designed and programmed to run on windows 98 or 2000, I can't
    remember right now, but its hardware requirements are very low.  This software runs very slows in the virtual pc, with the processor being the problem.  
    Matching the processor spike on the virtual pc using both performance monitor and task manager I compared it to task manager running on the host (my windows 7 machine).  The spikes in cpu matched one of the threads on my i7 processor (I use threads
    because an i7 has 8 threads but only 4 cores).  To my surprise when the CPU reached near 100% on the virtual PC the same spike on the host was only about 50% of the cpu thread.
    The host has a i7 950, 3.07GHz processor.  So this means that the virtual pc can only use up to 1.5GHz.  I have not run into the problem reported in other posts on this forum where the CPU is always at 50% or 100% on the virtual PC because when
    their is no activity the CPU drops to 10% or less and stays there.
    I will now have to use vmplayer, problem is having enough xp licenses for all users.
    Was anyone else aware of this?

    You can't use a half a thread.  Windows VPC uses one core at 3.07GHz, there's no halving the speed of the CPU. 
    The only way WVPC would use a lower clock speed is if there is power management throttling the CPU speed down.  Do you have a power management setting throttling your CPU?  Are you sure the problem is the CPU and not disk or network related? 
    Task manager on the host is not a very accurate way to determine CPU usage of the VM.
    If you have the correct version of Windows 7 (Pro or higher) there are no issues with XP Mode licenses, you get one license included with Windows 7.  There's no restriction requiring you to use XP Mode with Windows VPC, it will work under 3rd party
    virtualization solutions.

  • Can New Java 7 File API Path Objs Be Used For Windows Virtual Folders

    Hello,
    I'm trying to duplicate a JFileChooser's drop-down list containing root directories of the file system. For Windows machines, its combobox lists the roots in a nice tree-like layout. For example:
    + Desktop
      + Computer
        + Local Disk (C:)
        + Data (D:)I cannot find an offical way to do this; I ended up using a class called "ShellFolder" to do it. Based on the "File" objects returned by the "ShellFolder" operation, I wanted to use the "toPath" method of the "java.io.File" object to convert the object to a "java.io.file.Path" object. Unfortunately, when I try to convert it, a java.nio.file.InvalidPathException" occurs.
    Therefore, is there a way to use the the new Path object (provided by Java7's new File NIO APIs) that can map to Windows special virtual folders (like "My Computer" which is mapped to a CLSID like "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")?
    Note: It looks like NetBeans suffered from the same problem. See their bug report here: [https://netbeans.org/bugzilla/show_bug.cgi?id=214011] .
    Here's some sample code to reproduce the problem:
    static public void main(final String[] asArguments)
         javax.swing.SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run()
                   java.io.File homeFile = FileSystemView.getFileSystemView().getHomeDirectory();
                   System.out.printf("File obj for home dir = %s\r\n", homeFile.getAbsolutePath());
                   java.nio.file.Path homePath = homeFile.toPath();
                   System.out.printf("Path obj for home dir = %s\r\n", homePath.toString());
                   // get the root directories
                   java.io.File[] rootDirs = (java.io.File[]) sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");
                   for (int nIdx = 0; nIdx < rootDirs.length; nIdx++) {
                        java.io.File nextRoot = rootDirs[nIdx];
                        System.out.printf("File obj for next root dir = %s\r\n", nextRoot.getAbsolutePath());
                        // Is this a bug?
                        //          When we encounter a special Windows folder,
                        //          like "My Computer" which has a filename of "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                        //          why do we receive a "java.nio.file.InvalidPathException"?  Should it not resolve the path
                        //          to the virtual Windows folder of "My Computer", just like the java.io.File objects do?
                        //          If not, is there an alternative way to get that information using the new Java 7 File APIs?
                        java.nio.file.Path nextRootPath = nextRoot.toPath();
                        System.out.printf("Path obj for next root dir = %s\r\n", nextRootPath.toString());
                   } // for
              } // run
    } // mainEdited by: RhinoGuy on Aug 10, 2012 11:11 AM

    Hmm don't know about special folders but the File object does have a listRoots() method. Perhaps that only returns mapped drives on Windows though, I remember using it to create my own Eclipse type filechooser which I find a lot more user-friendly than the standard JFileChooser.

  • Using Windows.Devices.SmartCards API give 'System.UnauthorizedAccessException'

    Hi everybody,
    In the past I used the Windows.Devices.SmartCards APIs for Windows Phone 8.1 with success (https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.smartcards.aspx).
    Now i want to use the same APIs to connect my PC (Windows 8.1) to a SmartCardReader (e.g. ACR122) and read some data from a SmartCard.
    Unfortunately, when i use those APIs, a System.UnauthorizedAccessException is launched.
    How can i resolve it?
    Many thanks!
    This is the code:
    private async Task getSmartCardReader()
    string selector = SmartCardReader.GetDeviceSelector(SmartCardReaderKind.Generic);
    DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selector);
    Debug.WriteLine("Number of devices: "+devices.Count.ToString());
    if (devices != null && devices.Count != 0)
    foreach (DeviceInformation s in devices)
    try
    Debug.WriteLine("Device Id: "+s.Id);
    Debug.WriteLine("Device Name: " + s.Name);
    Debug.WriteLine("Is Device Enabled: " + s.IsEnabled);
    //Here is the line that launches exception
    SmartCardReader reader = await SmartCardReader.FromIdAsync(s.Id);
    catch (Exception e) {
    Debug.WriteLine(e.StackTrace);

    Does checking "Share User Certificates" in the capabilities help at all?
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

Maybe you are looking for